Skip to content

docs(adr): propose ADR-0037, queries are a subset of Obsidian Bases compiled to SQL - #143

Merged
bketelsen merged 3 commits into
mainfrom
docs/adr-0037-bases-queries
Nov 10, 2026
Merged

bketelsen merged 3 commits into
mainfrom
docs/adr-0037-bases-queries

Conversation

@frostyard-machines

Copy link
Copy Markdown
Contributor

Summary

Proposes ADR-0037, the query ADR that M5 "Graph and queries" needs first (roadmap). It answers the roadmap's open question "Query format: Obsidian Bases or a Frostnotes condition language".

  • The query format is Obsidian Bases (.base files and base code blocks), in Obsidian's syntax, with no keys of Frostnotes' own.
  • notesd evaluates every query through a new note.query method, so the app, the web app and MCP get one answer.
  • The M5 subset: filters (and/or/not, comparisons, file.hasTag, file.inFolder, file.hasLink, file.hasProperty, text, list and date functions), and table and card views with order, sort, limit and groupBy.
  • internal/query compiles the filters to one SQL condition over the existing index, with bound parameters only. A filter outside the subset is refused with an error that names it, never dropped.
  • What stays out at first: formulas, summaries, other view types, editing a base through a view, and Dataview DQL.
  • The rough shape of MCP query_notes.
  • The checks that M5's plan must add (an inventory of the Dataview dashboards, golden fixtures, fixtures with Obsidian's answers, an SQL-injection fuzz test, refusal tests, a benchmark, MCP and rendering tests).

Sources: Obsidian's public Bases docs (syntax, functions, views). No Obsidian code was read.

The ADR is Proposed. The roadmap's M5 row and open question link it, and docs/README.md indexes it.

Risk tier

Risk tier: 1 — docs only (1 new ADR, an index line, roadmap links). No code, no workflow, no path in .github/risk-paths.json.

Docs housekeeping

  • New docs started from their category's TEMPLATE.md
  • Every new doc indexed in docs/README.md
  • Cross-links added in both directions (ADR ↔ plan; the design docs and specs it shapes change with M5's code, as the ADR says)
  • New significant decision recorded as an ADR first, in this PR
  • New or edited ADRs are fact-only: context, decision and consequences

Verification

  • make check green (host)
  • Every relative link and section anchor in the changed lines resolves

@github-actions github-actions Bot added the level:L3 Skim label Nov 10, 2026
@frostyard-machines

Copy link
Copy Markdown
Contributor Author

Cross-review record. Coder: openai/gpt-6.1-sol (prose, from the parent's design brief); reviewer: anthropic/claude-opus-5-5, read-only. Base c1107de83bee64ef6d82cc46de172afad2d22bc6.

  • Initial review at 033c024: NOT READY, 1 blocking point (three-valued logic: !=, ! and not could lose rows with missing values) and 7 non-blocking points. All fixed in 91d3da8; the fix adds M5 check 10.
  • Re-review 1 at 91d3da8: PASS; 2 new non-blocking points (groupOrder ignored would show extra rows; hasLink with no base file had no start folder). Fixed in bcef6a0.
  • Re-review 2 at bcef6a0 (current head): PASS. 1 non-blocking note for M5's spec: what query_notes returns for a view that shows a notice.
    make check green on the host at bcef6a0; CI green at bcef6a0.

@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Nov 10, 2026
@bketelsen
bketelsen merged commit 15885fc into main Nov 10, 2026
11 checks passed
@bketelsen
bketelsen deleted the docs/adr-0037-bases-queries branch November 10, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:L3 Skim ready-for-human Reviewed, CI green: ready for Brian to review and merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants