Skip to content

find --meta results display a note_type value that matches nothing #1428

Description

@phernandez

The trap

find --meta note_type=X aliases to the frontmatter type: field, which holds the authored casing (Chapter). But the result row displays the snake-cased search-index projection (chapter). So the output shows you a value that, fed back into the same query, returns zero rows — silently, exit 0.

Verified against a live project:

$ bm find --meta 'note_type=chapter' --fields chapter_number --plain
exit=0                                       # <- zero rows, no error

$ bm find --meta 'note_type=Chapter' --fields chapter_number --plain
chapters/Chapter 1.md	{"chapter_number":"1"}
...
exit=0

$ bm find --meta 'note_type=Chapter' --json | jq '.results[0].metadata'
{"note_type": "chapter"}                     # <- the value that matches nothing

Same shape for multi-word types: LiteraryDevice is authored, literary_device is displayed.

Why it matters

An agent reading its own results learns the wrong value and writes a query returning nothing. Zero rows with exit 0 is indistinguishable from "no notes match" — the failure never announces itself. This is the same silent-wrong-answer class as the wrong-project writes (#1415) and the never-indexed empty reads (#1414).

Options

  1. Display the value that queries (authored type) rather than the index projection.
  2. Match case-insensitively on note_type predicates, so both spellings work.
  3. Normalize the predicate the same way the projection is normalized, so chapter matches Chapter.

(2) or (3) seem kinder than making callers care about which representation they are looking at; (1) alone still leaves the two spellings behaving differently.

Found while verifying the literary-analysis skill's documented commands (#1424), where every note_type example was written from the displayed value and therefore returned nothing.

🤖 Generated with Claude Code

https://claude.ai/code/session_014pmKq6bqCi6Zp6BTHuZjrp

Activity

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions