feat(node-type-registry): add RelationSpatial node type (v0.13.0)#997
Merged
pyramation merged 1 commit intomainfrom Apr 18, 2026
Merged
feat(node-type-registry): add RelationSpatial node type (v0.13.0)#997pyramation merged 1 commit intomainfrom
pyramation merged 1 commit intomainfrom
Conversation
Documents the RelationSpatial blueprint entry shape so blueprint authors get TypeScript validation. Consumed by constructive-db's construct_blueprint dispatcher (see constructive-db #844), which resolves source_field_id / target_field_id and forwards to provision_spatial_relation. - src/relation/relation-spatial.ts: parameter_schema + 8-operator enum - src/relation/index.ts: re-export RelationSpatial - blueprint-types.generated.ts: regenerated via src/codegen/generate-types.ts (RelationSpatialParams + RelationSpatial entry in the BlueprintRelation union) - package.json: 0.12.0 -> 0.13.0 (new public export, minor bump)
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:
|
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
Adds the
RelationSpatialnode type tonode-type-registry, documenting the parameter shape for declarative spatial relations in blueprints. Consumer-side companion to constructive-io/constructive-db#844, which implementsprovision_spatial_relationand wiresconstruct_blueprintto dispatch on$type = 'RelationSpatial'.Changes
src/relation/relation-spatial.ts(new):RelationSpatialdefinition. Parameter schema uses UUIDs (source_table_id,source_field_id,target_table_id,target_field_id) matching the node-type-registry convention for other Relation* entries. 8-operator enum (st_contains,st_within,st_intersects,st_covers,st_coveredby,st_overlaps,st_touches,st_dwithin).param_nameoptional — enforced NULL-unless-st_dwithinby the table CHECK on the metaschema side, not re-checked here.src/relation/index.ts: re-exportRelationSpatial.src/blueprint-types.generated.ts: regenerated viasrc/codegen/generate-types.ts. AddsRelationSpatialParamsinterface + a new entry in theBlueprintRelationdiscriminated union.package.json:0.12.0→0.13.0(new public export → minor bump).Blueprint author shape
Note that blueprint JSON itself uses names (
source_table,source_field, etc.);construct_blueprinton the constructive-db side resolves those to UUIDs before callingprovision_spatial_relation. The*_idfields on this node type document the resolved procedure signature, not the author-facing JSON. This matches howRelationBelongsTo/RelationHasOne/ etc. are documented today.Review & Testing Checklist for Human
param_namerule match the metaschema CHECKs in constructive-db'sspatial_relationtable (specifically: exactly these 8 operators;param_namerequired iffoperator = 'st_dwithin'). If either drifts, blueprints will be accepted at authoring time but rejected at provision time.src/blueprint-types.generated.tswas produced by runningnpx ts-node src/codegen/generate-types.ts. Worth a quick glance to confirm the diff looks like codegen output (comments from the JSON-schema descriptions, discriminated-union entry parallel to the other relation types) and not hand-edits.Test plan
RelationSpatialend-to-end, which is the real validation of the contract documented here.Notes
"$type": "RelationSpatial"without it. The node type entry adds TypeScript autocomplete/validation for blueprint authors and lets the metaschema introspection list it alongside the other relation types.st_dwithindefault distance arg.Link to Devin session: https://app.devin.ai/sessions/c5eeee65a3c546c4ac6753bb05fa03e0
Requested by: @pyramation