Skip to content

Workbench Query Console — write, execute, browse, time-travel (4 phases) #386

Open
1 of 4 issues completed

Description

@nockawa

🔄 Re-scoped 2026-06-29

Granularity: Epic · Area: Workbench

A Workbench view that closes the author → run → see results → iterate loop against a live .typhon file (the authoring half that Query Analyzer, post-hoc only, lacks).

✅ Shipped: Phase 1 — Author + Run + Browse merged to main via PR #390 (commit 52e150a) — panels/QueryConsole/ + useQueryConsoleStore, chip + DSL editor, QuerySpec IR + parser + EcsQuery<T> compiler, REST query/plan|execute|parse, virtualised result grid, live cost chip, G Q chord (Analyzer → G W), localStorage saved queries/history. (Deviations: <textarea> not Monaco; TanStack Virtual div-grid.)

✅ Done: #388 — SPATIAL execution (NEARBY / AABB / RAY), merged alongside Phase 1 in PR #390.

🔲 Remaining — tracked as Feature sub-issues:

Design: claude/design/Apps/Workbench/views/query-console.md. Full phase checklists + decisions preserved in edit history.

Sub-issues

Sub-issues

1 of 4 Issues completed
Loading 4 sub-issues

Activity

  1. self-assigned this
    on May 28, 2026
  2. moved this to Ready in Typhon devon May 28, 2026
  3. moved this from Ready to In Progress in Typhon devon May 28, 2026
  4. nockawa commented on May 28, 2026

    @nockawa
    CollaboratorAuthor

    Phase 1 Implementation Plan — Approved

    Scope: Phase 1 only (Author + Run + Browse — minimum viable loop).
    Branch: feature/386-query-console (Typhon + nested claude/ repos).
    Plan file: local to working agent.

    Acceptance Criteria (19 ACs + 2 pre-flight gates)

    Pre-flight (verification gates):

    • P1 — Verify Schema endpoints return real field names (§14.4 gate).
    • P2 — Confirm ExpressionParser.ParseDnf invariants for parser pre-validation.

    Engine (1 internal-method touch):

    • AC-1 — Add internal EcsQuery<TArchetype>.AddFieldPredicateBranches(FieldPredicate[][]) + NUnit fixture.

    Server / Workbench host:

    • AC-2 — Dtos/Query/ records (QueryPlanDto, QuerySpecDto, QueryResultDto, QueryRowDto, request/response DTOs).
    • AC-3 — QueryConsoleService (stateless singleton, session→tx resolution).
    • AC-4 — Recursive-descent DslParser (full §5.1 grammar; NAVIGATE/SPATIAL parsed-only-stored).
    • AC-5 — QuerySpecCompiler (reflection-based; uses AC-1 helper).
    • AC-6 — QueryConsoleController with /plan, /execute, /parse.
    • AC-7 — QueryException subclasses → WorkbenchExceptionHandler with stable codes.

    Client / Workbench UI:

    • AC-8 — orval regen (useQueryConsolePlan, useQueryConsoleExecute, useQueryConsoleParse).
    • AC-9 — QueryConsolePanel (toolbar + stage stack / DSL editor + result grid).
    • AC-10 — useQueryConsoleStore (Zustand, plain spread — no Immer).
    • AC-11 — Chip widgets (FROM / WITH / WHERE / ORDER BY / SKIP-TAKE).
    • AC-12 — DslEditor (Monaco; new dep @monaco-editor/react).
    • AC-13 — Live cost chip (250 ms debounce).
    • AC-14 — Result grid (shadcn Table + @tanstack/react-virtual; default TAKE 1000).
    • AC-15 — Saved queries (localStorage via safeStorage).
    • AC-16 — History rail (in-memory bounded ring, last 50).
    • AC-17 — Cross-pillar handoffs (Schema Explorer + Data Browser → Console).
    • AC-18 — Chord rebind (G Q → Console, G W → Analyzer) + palette + view-menu.
    • AC-19 — Doc updates (IA §9.4 + query-analyzer.md §2 chord).

    Deviations from design doc (called out explicitly per CLAUDE.md)

    # Design says Plan ships Why
    D1 ExecutionPlanDto (§6.3) QueryPlanDto Matches Query* prefix of existing Profiler DTOs
    D2 "Immer-style mutator" (§7.1) Plain spread mutator Matches existing Workbench convention; Immer not in deps
    D3 tx.Query<T>(polymorphic: bool) (§4.2) tx.Query<T>() / tx.QueryExact<T>() Engine has two factories
    D4 Plan DTO carries evaluator list from Phase 1 Minimal Phase 1 (3 estimate fields + per-eval array); evaluator list lands in Phase 2 Plan drawer is Phase 2; no consumer in Phase 1

    All deviations doc'd in query-console.md post-Phase-1 (mechanical edits via AC-19).

    Code review gate

    Completion blocked until: self-review of full diff vs every AC + design doc + Typhon standards (.editorconfig, no LINQ on hot paths, [LoggerMessage], no nullable reference types, 160-col max), /code-review, /security-review (DSL parser is user-input-facing), no claude/rules/ invariant violated.

    🤖 Generated with Claude Code

  5. reopened this on Jun 3, 2026
  6. added theissue type on Jun 29, 2026
  7. moved this to In Progress in Typhonon Jun 29, 2026
  8. updated Target date 2026-07-15 and Start date 2026-06-29 on Jun 29, 2026
  9. removed Start date and Target date on Jul 1, 2026
  10. added this to the pre-alpha milestone on Jul 1, 2026
  11. added a commit that references this issue on Oct 1, 2026
  12. modified the milestones: pre-alpha, beta-1 on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

Area

Workbench

Estimate

None yet

Start date

None yet

Target date

None yet

Product

Workbench

Projects

  • Status
    In Progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions