Skip to content

Port vector property dimension validator from UPX (IMP-1270) - #83

Open
paven wants to merge 5 commits into
mainfrom
imp-1270-vector-property-dimension
Open

Port vector property dimension validator from UPX (IMP-1270)#83
paven wants to merge 5 commits into
mainfrom
imp-1270-vector-property-dimension

Conversation

@paven

@paven paven commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Ports rule 8 from UPX getVectorDimensionPropertyErrors (errors.ts#L124-L130, called for nodes at L522 and relationships at L708) as NodePropertyVectorDimension and RelationshipPropertyVectorDimension validators in the importReady group.

Call site

Single shared call site: getDataModelErrors (errors.ts#L781), consumed from 3 places - gates Run Import in both import and kg-builder.

Code remap

The issue code is missing_vector_dimension (snake_case, per the graph-spec port convention set in #75), while UPX keys on MISSING_VECTOR_DIMENSION. JS consumers matching on the uppercase string need remapping when they adopt graph-spec validations.

Refs: IMP-1270

paven added a commit that referenced this pull request Sep 2, 2026
Exercises the nodes/relationships threading through the path field,
not just the issue code. Addresses review finding on PR #83.
@paven
paven force-pushed the imp-1270-vector-property-dimension branch 6 times, most recently from 22f9edc to 28cf0bf Compare September 4, 2026 14:41
@paven
paven marked this pull request as ready for review September 4, 2026 16:46
Port UPX rule 8 (getVectorDimensionPropertyErrors, errors.ts lines 124-130)
to graph-spec. Flags a property when its type is a VECTOR variant and
dimension is null.

- PropertyVectorDimension.kt: shared helper (vectorDimensionIssue)
- NodePropertyVectorDimension: NodeValidation, overrides validateProperty
- RelationshipPropertyVectorDimension: RelationshipValidation, overrides validateProperty
- Issue code: missing_vector_dimension
- Registered both in importReady group in Validations.kt
Exercises the nodes/relationships threading through the path field,
not just the issue code. Addresses review finding on PR #83.
isVectorType is now a predicate in validate/property/PropertyVector.kt,
matching the Compositeness.kt precedent. Each validator builds its own
Issue and owns its path - no ownerKind string parameter threading
nodes./relationships. prefixes through the helper.
- isVectorType: drop else->false, list all non-vector variants so the
  when is exhaustive (matches Neo4jType.toString precedent) - the
  compiler now forces an explicit decision for future variants
- Message: 'Missing dimension for vector property X on node Y' to match
  the repo's greppable Missing-prefix message family
- Tests: assert issue.message, add dimension=0 boundary pass-case
  (0 counts as set, matching UPX isNullish)
UPX enforced MIN_DIMENSION=1/MAX_DIMENSION=4096 only in the UI input
cell (commons/ui details-panel constants); graph-spec now makes it a
data invariant. Split into independent validators per the series
convention (one validator per error):

- NodePropertyVectorDimensionBounds / RelationshipPropertyVectorDimension
  Bounds: flags dimension outside 1-4096 as invalid_vector_dimension
- NodePropertyVectorDimension / RelationshipPropertyVectorDimension:
  unchanged, presence-only missing_vector_dimension (UPX rule 8)
@paven
paven force-pushed the imp-1270-vector-property-dimension branch from 28cf0bf to db7ac0a Compare September 7, 2026 07:37
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