Drive document editor fields from the schema #59

Merged
lost-rob0t merged 1 commit from feat/spec-driven-document-editor into main 2026-07-26 01:44:43 +00:00
lost-rob0t commented 2026-07-26 01:43:08 +00:00 (Migrated from github.com)

Summary

Makes the canonical StarIntel JSON Schema—not a secondary expansion list or hand-built model—the source of truth for document editor fields.

  • derives the form from the selected dtype's actual data.properties
  • Person now exposes fname, mname, lname, names, dates, affiliations, identifiers, and every other allowed Person property
  • switching to Organization replaces Person fields with name, legal_name, org_type, industry, registration, ownership, location, and the rest of the Org schema
  • shows exact schema property keys in field labels
  • uses schema types for text, number, integer, boolean, enum, array, object, and nullable fields
  • removes the obsolete duplicate hardcoded JSON editor
  • removes the graph's generic document JSON modal; typed graph creation now opens the canonical schema editor
  • returns a saved graph-created document to its graph, preserving its clicked position and selection
  • keeps raw canonical JSON as an explicit advanced mode
  • reduces collection/object field editors to compact JSON inputs

Root cause

The editor used fieldsForDtype(), which represents the expansion inventory rather than the complete conditional JSON Schema property set. Valid compatibility properties such as Person fname, mname, and lname existed in the schema but were omitted from the UI.

Validation

  • npm test — 19 unit files / 76 tests and 1 integration test passed
  • npm run check — formatting, ESLint, TypeScript, and static checks passed
  • npm run build — passed
  • added schema tests proving Person and Organization expose distinct property sets
  • Playwright switches Person → Organization → Person, checks the expected fields, saves a Person, and returns to the graph

Follow-up to #57.

## Summary Makes the canonical StarIntel JSON Schema—not a secondary expansion list or hand-built model—the source of truth for document editor fields. - derives the form from the selected dtype's actual `data.properties` - Person now exposes `fname`, `mname`, `lname`, names, dates, affiliations, identifiers, and every other allowed Person property - switching to Organization replaces Person fields with `name`, `legal_name`, `org_type`, industry, registration, ownership, location, and the rest of the Org schema - shows exact schema property keys in field labels - uses schema types for text, number, integer, boolean, enum, array, object, and nullable fields - removes the obsolete duplicate hardcoded JSON editor - removes the graph's generic document JSON modal; typed graph creation now opens the canonical schema editor - returns a saved graph-created document to its graph, preserving its clicked position and selection - keeps raw canonical JSON as an explicit advanced mode - reduces collection/object field editors to compact JSON inputs ## Root cause The editor used `fieldsForDtype()`, which represents the expansion inventory rather than the complete conditional JSON Schema property set. Valid compatibility properties such as Person `fname`, `mname`, and `lname` existed in the schema but were omitted from the UI. ## Validation - `npm test` — 19 unit files / 76 tests and 1 integration test passed - `npm run check` — formatting, ESLint, TypeScript, and static checks passed - `npm run build` — passed - added schema tests proving Person and Organization expose distinct property sets - Playwright switches Person → Organization → Person, checks the expected fields, saves a Person, and returns to the graph Follow-up to #57.
Sign in to join this conversation.
No description provided.