Skip to content

feat: move node-type-registry to packages/ and add column-ref annotations#1043

Merged
pyramation merged 2 commits intomainfrom
feat/node-type-registry-move-and-column-ref
May 1, 2026
Merged

feat: move node-type-registry to packages/ and add column-ref annotations#1043
pyramation merged 2 commits intomainfrom
feat/node-type-registry-move-and-column-ref

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

Summary

Two changes in one PR:

1. Move graphql/node-type-registrypackages/node-type-registry

The node-type-registry is platform-level infrastructure (used by blueprints, codegen, and the SQL metaschema), not graphql-specific. Moves it alongside packages/safegres where it belongs. The pnpm-workspace.yaml already includes packages/*, so no workspace config changes needed.

2. Add "format": "column-ref" JSON Schema annotations

Every parameter_schema property 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:

  • Authz* (16 types): 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_key
  • Data* (19 types): field_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_fields
  • Search* (7 types): field_name, source_fields, source_geom_field, source_fk_field, trgm_fields, boost_recency_field
  • Relation* (5 types): field_name, source_field_name, target_field_name
  • View* (5 types): group_by_fields, field_names, primary_columns, primary_field, join_field, columns

Why: The downstream constructive-db SQL codegen package (PR #967) compiles these definitions into a metaschema_public.node_type_registry SQL table. With format: "column-ref" annotations, any SQL trigger (like embedding_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

  • Verify the move doesn't break any imports in downstream packages that depend on node-type-registry by npm name (should be transparent since package.json name is unchanged)
  • Spot-check a few 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)
  • Run pnpm build in packages/node-type-registry to verify TypeScript compilation

Notes

  • The format: "column-ref" annotation follows JSON Schema conventions — format is the standard keyword for semantic type hints
  • For array-of-column-refs (e.g., entity_fields, source_fields), the annotation is placed on the items schema, not the array itself
  • Types with no column-ref properties (AuthzAllowAll, AuthzDenyAll, AuthzComposite, DataTimestamps, DataSoftDelete, etc.) are left unchanged
  • After this merges, the constructive-db node-type-registry codegen package needs to be regenerated to pick up the new annotations

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

…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).
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 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

@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpgpm@​1.4.27510010098100

View full report

@pyramation pyramation merged commit 06bbe99 into main May 1, 2026
52 checks passed
@pyramation pyramation deleted the feat/node-type-registry-move-and-column-ref branch May 1, 2026 21:56
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