Skip to content

feat: query engine + expression surface over the trace DB (Layer 5) #31

Description

@chayan-bit

Gap

README §2 calls Layer 5 the "query & introspection engine" but only ever describes point-in-time operations. Once a recording is an indexed database (see the trace-DB and write-index issues), it needs an actual query surface — and that surface must be shared by both consumers: DAP (humans in VS Code / Workbench) and MCP (agents). One engine, two protocol adapters. Building the query logic twice, once per protocol, is how the two surfaces silently diverge.

Scope

  • Query engine crate sitting above the trace DB, below DAP and MCP.
  • Query kinds, minimally: events_between(seq_a, seq_b, filter), writes_to(addr | expr), value_became(expr, value), origin_of(seq, addr), task_timeline(task), wake_chain(task).
  • Expression evaluation against a materialized program state at a sequence number (reuse the DWARF/locals path, don't fork it).
  • Results carry (seq, thread, task, logical stack) uniformly so both adapters render the same thing.
  • Queries that need data not yet indexed transparently fall back to a replay pass and (optionally) populate the index.

Explicit constraint

No DAP types and no MCP types in this crate. The adapters depend on it; it depends on neither.

Done when

DAP listCheckpoints/taskTimeline/jumpToEvent (#27) are implemented as thin translations of query-engine calls, and an MCP adapter can be added without touching this crate.

Ref: README §2, §7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureProduct feature work

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions