Skip to content

Schema fields should be satisfiable by frontmatter, not only observations #1973

Closed

Description

@phernandez

Found in the 1.0 live MCP test (post-1.0).

What happens

A Picoschema field matches only observations. A note with the field in its frontmatter still fails it:

# schemas/Meeting Schema.md
type: schema
entity: meeting
schema:
  attendees: integer, how many attended
# meetings/Standup Monday.md
type: meeting
attendees: 4

bm_schema(command="validate", note_type="meeting") warns: Missing required field: attendees (expected [attendees] observation). infer and diff also ignore frontmatter fields: infer suggested only action (from - [action] observations), and diff reports attendees as dropped.

Why it matters

Scalar facts like counts, dates, status and owners naturally live in frontmatter, and bm_write(metadata=...) and bm_edit(command="set_metadata") put them there. Today a schema can't describe the fields our own tools write. bm-schema(3) doesn't say fields are observation-only either.

Options

  • Let a field be satisfied by a frontmatter key or an observation category, with frontmatter checked first. Type checks (integer, string, enums) apply naturally to frontmatter values.
  • Or add an explicit source per field, e.g. attendees(frontmatter).
  • In either case, infer/diff should count frontmatter keys, and bm-schema(3) should state the rule.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8

Activity

  1. claude commented on Oct 29, 2026

    @claude
    Contributor

    Claude finished @phernandez's task in 15s —— View job


    Triage

    • Type: Enhancement (applied the enhancement label). It could also be read as a gap or bug, because the schema feature can't describe the fields that bm_write(metadata=...) and bm_edit(set_metadata) write.
    • Component: MCP tools (bm_schema validate/infer/diff) and the picoschema module. This isn't Cloud-specific.
    • Priority: Medium. There's a workaround (put the value in an observation), but schemas can't validate frontmatter, and infer/diff give misleading output.
    • Complexity: Medium. It touches validation, inference and drift in the picoschema code, plus the bm-schema(3) manual page, and it needs tests at 100% coverage.

    Duplicates: I found none. Related closed issues are #794 (picoschema modifiers), #375 (schema support) and #993 (frontmatter validation and permissions). None covers frontmatter-satisfied fields.

    Design question before implementation: the issue offers two options.

    1. A field is satisfied by a frontmatter key or an observation category, with frontmatter checked first.
    2. An explicit per-field source, such as attendees(frontmatter).

    Option 1 is simpler and needs no schema syntax change. It does make it ambiguous where a field's value lives. The ambiguity matters for infer: when a name appears in both places, which source should it suggest? Option 2 is explicit but adds syntax to Picoschema. Either way, infer/diff should count frontmatter keys, and bm-schema(3) should state the rule. Which option do you prefer?

  2. added this to the nextup milestone on Nov 3, 2026
  3. phernandez commented on Nov 3, 2026

    @phernandez
    MemberAuthor

    Decision: a schema field can be satisfied by a frontmatter key or by an observation category. Frontmatter is checked first.

    • Type checks (integer, string, enums) apply to frontmatter values the same way.
    • There's no per-field source syntax such as attendees(frontmatter).
    • infer and diff count frontmatter keys as fields.
    • bm-schema(3) states the rule.
  4. added a commit that references this issue on Nov 4, 2026
    44bc235
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

    enhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions