Skip to content

find --fields returns numeric frontmatter values as strings #1456

Description

@phernandez

What happens

bm find --meta … --fields chapter_number --json returns "fields": {"chapter_number": "63"} for a note whose frontmatter stores chapter_number: 63. Metadata predicates on the same field compare numerically (chapter_number>100 works), so the projection and the predicate disagree about the value's type.

Repro on the Moby Dick project:

bm find --meta 'note_type=chapter' --fields chapter_number,pov --page-size 2 --project moby-dick --json
# fields.chapter_number -> "63" (str), "62" (str)

Why it matters

Every consumer has to re-parse projected numbers (tonumber in jq, int() in Python); the skill's coverage jq currently does this defensively without knowing it is load-bearing. Booleans and dates presumably round-trip the same way.

Expected

Projected values keep the JSON type the frontmatter parsed to (int, float, bool, list), the same values the predicate layer compares against.

Found during the #1398 Moby Dick qualitative run.

🤖 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