Skip to content

feat(fanql): FanQL text query language with HTTP, MCP and AI-optional UI - #410

Merged
vishr merged 31 commits into
mainfrom
feat/fanql
Oct 30, 2026
Merged

vishr merged 31 commits into
mainfrom
feat/fanql

Conversation

@vishr

@vishr vishr commented Oct 30, 2026

Copy link
Copy Markdown
Member

What changed

Adds FanQL, a compact text form of Fanout's structured query, so people and
agents can query telemetry without an LLM key or raw SQL:

logs where service:api severity>=error | count() by service every 1m
  • Hand-written lexer and recovering parser, resolver against the telemetry
    catalog, and lowering to the existing structured query. A canonical
    printer lifts stored queries back to text through the engine parser.
  • Conditional aggregates (count_if, …) and measure arithmetic for spans
    and logs, using one shared measure grammar with query budgets and a
    disclosed 20-sample ranking floor.
  • Diagnostics report every independent problem in source order, with field-
    specific repairs and one-click fixes (span, fix_its).
  • Completion is position-aware, with bounded, coalesced schema fetches and
    absolute or relative windows.
  • HTTP: POST /api/fanql/parse, POST /api/fanql/format,
    POST /api/fanql/complete, GET /api/fanql/reference.
  • MCP: query_telemetry accepts optional FanQL text (syntax and examples
    inline). The reference is published as fanout://fanql/reference and in
    the site docs, generated from the same registries the engine uses.
  • UI: AI controls are hidden when chat is disabled (supersedes feat(ui): hide AI controls when chat is disabled #395).
  • Design: docs/specs/2026-10-29-no-llm-ui-design.md (section 0).

FanQL lowers to the existing validated query, so the arbitrary SQL rules and
telemetry relations are unchanged. There is no language version field.

Verification

  • just check (pre-push and CI)
  • just test-race
  • Corpus, round-trip, truth-table, fuzz and diagnostic-copy tests;
    latency budgets as opt-in benchmarks (just fanql-perf)
  • Two-axis code reviews (standards and spec); all findings fixed with
    regression tests
  • Generated HTTP, MCP and site references updated
  • No credentials, private telemetry, host details, or enterprise-only source
  • API and MCP contract additions are called out above; no migrations,
    ingest or release-contract changes

vishr added 30 commits October 29, 2026 15:27
Remove language-version negotiation from HTTP, MCP, envelopes, and generated references. Keep query text optional for MCP.

Reduce repeated formatter shape checks and keep bounded spelling-distance buffers on the stack so allocation limits retain headroom. Isolate the settlement regression from repeated checkout hashing.
@vishr
vishr merged commit 4ac9a50 into main Oct 30, 2026
17 checks passed
@vishr
vishr deleted the feat/fanql branch October 30, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant