Skip to content

Untitled non-root nodes are unreachable by keyword search #2253

Closed as not planned

Description

@malibio

Summary

search_nodes matches its keyword against title. A node whose title is NULL therefore cannot be found by keyword at all, no matter what its content says — and compute_title leaves title NULL for a large, ordinary class of nodes.

Surfaced during the #2249 re-review. Pre-existing and not introduced by that PR — filed separately so it is not buried in a fix for a different bug.

Mechanism

compute_title (packages/core/src/services/node_service/crud.rs) resolves a title in this order:

  1. date / schema types → always None
  2. Schema carries a title_template → built from properties
  3. Otherwise, content-derived — but only for task/collection, or for a root node

So a non-root node of any other type (a child text node, a nested instance of a user-defined type without a template) gets title: None and is invisible to keyword search.

Why it went unnoticed

Both search paths have the identical blind spot, so nothing looks inconsistent from the outside:

The failure mode is the quiet kind this codebase keeps running into: count: 0 reported as a success, indistinguishable from "nothing matches".

Reproduction sketch

Create a non-root node of a template-less, non-task type whose content contains a distinctive word, then search_nodes for that word. Expect the node; get count: 0.

Possible directions

  1. Widen the keyword filter to match title OR content on both paths. Closest to what a user means by "search"; needs a decision on whether content matches should rank below title matches.
  2. Populate title for more node types — treat content-derived titles as the default rather than the root/task special case. Larger blast radius: title is user-visible in the UI and in tool results, so this changes what is displayed, not just what is findable.
  3. Leave matching as-is and surface the gap — have a zero-result search say that untitled nodes are not keyword-searchable. Weakest option; makes the limitation legible without fixing it.

Direction 1 looks right, but the ranking question should be settled before implementing.

Note

Worth checking whether the FTS path (node_fts) has the same blind spot or already indexes content independently — if it does, the two search surfaces disagree about what is findable, which is its own defect.

Activity

  1. malibio commented on Aug 23, 2026

    @malibio
    CollaboratorAuthor

    Closing — this is the design working as intended, not a gap. My framing was wrong.

    Non-root nodes are body contents. They are not supposed to be reachable via keyword search, and title being NULL for them is precisely the mechanism that encodes that: a title marks something as a document with its own identity, and body text under it is not separately addressable by keyword.

    That also resolves the open question I raised at the bottom of this issue — whether the two search surfaces disagree. They don't, they have different jobs:

    • node_fts indexes content for every node, with no root/non-root distinction (v001_initial_schema.rs:98). Body text IS reachable, through FTS/semantic search.
    • search_nodes's structured keyword filter matches title, which deliberately means "find me a document", not "find me any line of text that mentions this".

    So the three directions I sketched are all wrong to pursue. Direction 1 (title OR content) would be actively harmful — it would make every body line a top-level structured search hit, flooding results with fragments the user did not ask for and eroding the distinction that makes search_nodes useful to an agent. Direction 2 would put titles on body nodes, changing what is displayed in the UI to fix a non-problem.

    No action needed. Recording this so the reasoning is findable if the same observation resurfaces: a count: 0 from search_nodes for text that exists in a body node is correct behavior, and the right route to that text is the FTS/semantic path.

    The #2249 fix (PR #2252) is unaffected — it made the two structured paths agree on filtering by title, which is the correct semantics either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions