You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Relationships: add field/fieldOn support for parent-side wikilink arrays #50
$metadata.relationships hardcodes 'parent' as the child-side field in both validation (validate-hierarchy.ts) and embedded parsing (parse-embedded.ts). This conflates relationship edges with hierarchy edges — parentNodeProps in _ost_tools_base.json defines parent as the hierarchy wikilink field, and it should remain reserved for that purpose.
Many schemas express relationships via parent-side wikilink arrays (e.g., Activity.tasks, Activity.outcomes). Previously these were silently skipped during relationship validation, and embedded nodes got a spurious parent field instead of populating the correct parent-side array.
The hierarchy edge system already supports field/fieldOn — relationships now have the same.
Solution
Added field (default: "parent") and fieldOn (default: "child") to RELATIONSHIP_SCHEMA.
fieldOn: "parent" (new)
parse-embedded: child node gets no parent field; [[Child Title]] is appended to the semantic parent node's rel.field array
validateRelationships: filters parent-type nodes; validates each rel.field array entry resolves to a node of rel.type
fieldOn: "child" (default, existing behaviour)
parse-embedded: sets schemaData[rel.field ?? 'parent'] on child instead of hardcoded schemaData.parent
validateRelationships: same logic, but uses rel.field ?? 'parent' instead of hardcoded 'parent'
Changes
src/metadata-contract.ts — Added field and fieldOn to RELATIONSHIP_SCHEMA
src/parse-embedded.ts — fieldOn: "parent" support for list and table embedded nodes
src/validate-hierarchy.ts — validateRelationships() branches on fieldOn
Activity
mindsocket commentedon Mar 17, 2026
Completed in #52