Options-type fields (SYS_D12) never indexed into field_values — tana_related returns no connections for affected supertags
Description
Nodes whose fields use Tana's "options" field type have zero entries in field_values after indexing. This means tana_related returns no connections for any field-based relationship on these nodes, even when connections are clearly set in Tana.
Affected supertags in our workspace (all use options-type Connected To): #improvement (10 nodes), #issue (1 node), #insight (12 nodes), #thread (32 nodes) — all have 0 field_values indexed.
Root cause
Tana has two structurally distinct field types that look identical in the UI but differ in the export format:
Instance/reference field (SYS_D05) — e.g. #log → Connected To:
- attrDef child 1:
typeChoicetuple withSYS_T06+SYS_D05 - attrDef child 2:
SYS_A06"Selected source supertag" (constrains to a supertag type) - Selected value appears as sibling of attrDef in the parent tuple
- Indexed correctly ✅
Options field (SYS_D12) — e.g. #improvement → Connected To:
- attrDef child 1:
typeChoicetuple withSYS_T06+SYS_D12 - attrDef child 2:
SYS_T51"Values" tuple — an embedded pool of all selectable nodes - Selected value appears as sibling of attrDef in the parent tuple (same position)
- Never indexed ❌
The selected value is in the same structural position for both types. The indexer appears to bail out on options fields rather than extracting the sibling value node.
Export structure comparison
# WORKS — log tuple (instance field, SYS_D05):
tuple (-2xvOy_mmIY3)
├── attrDef "Connected To" (Do_-4PsG2nBc)
│ ├── typeChoice [SYS_T06, SYS_D05]
│ └── SYS_A06 "Selected source supertag"
└── k_Z7Q9NE4A "initiative" ← value, gets indexed ✅
# BROKEN — improvement tuple (options field, SYS_D12):
tuple (aMcXMr7n2fkN)
├── attrDef "Connected To" (vvG8mLR8SebH)
│ ├── typeChoice [SYS_T06, SYS_D12]
│ └── SYS_T51 "Values" (pool of 18+ selectable nodes)
└── Fz2fmxLLVobh "Chad System Simplification" ← value, never indexed ❌
Expected behaviour
Both field types should produce a field_values row. The selected value node is the sibling of the attrDef in both cases — the extraction logic should work identically regardless of whether SYS_D05 or SYS_D12 is the type discriminator.
Impact
Any supertag whose reference-type fields use the options field type (SYS_D12) gets zero field_values indexed. tana_related returns empty for all such nodes. In our case this includes the primary operational node types used for knowledge management workflows.
Version
2.5.10
Thanks for the structural comparison. I checked the extraction path on current main (v2.5.11): isFieldTuple / extractFieldValuesFromNodes in src/db/field-values.ts never look at the typeChoice, SYS_D12 or SYS_T51 children, so the indexer doesn't skip options fields on purpose.
There are three places where the row could still be dropped:
- The tuple's label child has no
props.name. - The selected option node isn't in the index, or has an empty name.
- The tuple-parent walk never reaches the owning node.
To find out which one applies, could you share one redacted options tuple from an export: the tuple node, its attrDef child and the selected value node, with their props and children? I'll turn it into a fixture and fix it from there.