add debugging
make sure query results are distinct
add fixme that was the cause for the breakage this morning

the current algorithm assumes that a value will exist, and uses that
value to infer a list of types which then in some cases will look
correct.

cannot pursue the autocomplete functionality in the webapp until this is
fixed in the generic case where there is no current value