Traversal v1 (1/4): label oracle and /resolve support profiling

AD
3h ago
+2349-32

First of four stacked PRs that bring labeled traversal from gr/labeled-traversal (d5d26baa) onto master. Next: #709 (walker), #710 (CLI and routes), #711 (Python client and docs).

This PR adds the backend of the experimental /resolve route. For a query sequence, it reports which labels carry which runs of its k-mers and picks seeds for /traverse. A label is an annotation column or, on an index with coordinates and a header index, one sequence record.

  • LabelOracle and LabelQuery map query k-mers to annotation rows in every graph mode and read the requested labels there.
  • Label discovery uses the /search signature ranking (get_top_label_signatures), so both report the same labels.
  • select_seeds repeatedly picks the interval carried by the most labels.
  • CoordToHeader gains a header-to-record index, 8 bytes per record.
  • On row-diff annotations, a walk keeps the rows it decodes, which makes /traverse 2.5x faster.

Outside traversal: get_header_results throws instead of exiting, and the aligner shares the new CanonicalDBG::with_node_first_cache.

Co-authored-by: Gunnar Rätsch

🤖 Generated with Claude Code