Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 46 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,54 @@ security, read-only execution, bounded recovery, and complete run artifacts.

## Product Tour

Studio is a desktop data workspace with persistent navigation, a shared domain
switcher, and light and dark themes. The screenshots below show the running local
interface at a 1440 × 1000 desktop viewport, using the synthetic Anime Streaming
sample. Analysis and history are explicitly labelled as demo data, not live results.

<div align="center">
<img src="docs/assets/queryforge-studio-domains.png" width="100%" alt="QueryForge Data Domain Center for creating and selecting isolated business contexts">
<sub>Data Domain Center — create or select a governed context before adding data or semantics.</sub>
<sub>Data Domains · select a business context or create a new one, with the onboarding path in view.</sub>
</div>

<br>

<div align="center">
<img src="docs/assets/queryforge-studio-overview.png" width="100%" alt="QueryForge Studio overview with semantic health, business metrics, and engagement trends">
<sub>Domain overview — the Anime Streaming dataset is shown as one selected sample, not the platform identity.</sub>
<sub>Overview in dark mode · ask a question, inspect sample metrics, and open the semantic workspace.</sub>
</div>

<br>

<div align="center">
<img src="docs/assets/queryforge-studio-semantic.png" width="49%" alt="QueryForge Semantic Studio entity relationship graph and contract editor">
<img src="docs/assets/queryforge-studio-analysis.png" width="49%" alt="QueryForge governed analysis result with generated SQL and Trust Trace">
<br>
<sub>Semantic Studio &nbsp;·&nbsp; Governed analysis with auditable SQL and Trust Trace</sub>
<img src="docs/assets/queryforge-studio-semantic.png" width="100%" alt="QueryForge Semantic Studio with searchable entities, an automatically fitted relationship graph, and a read only sample contract inspector">
<sub>Semantic Studio · explore entities, search metrics, zoom the relationship graph, and inspect the sample contract.</sub>
</div>

<br>

<div align="center">
<img src="docs/assets/queryforge-studio-analysis.png" width="100%" alt="QueryForge desktop analysis with a demo answer, result chart, generated SQL, and clearly labelled Trust Trace">
<sub>Ask &amp; Analyze · compare the result chart and SQL beside the evidence panel. Demo provenance stays visible.</sub>
</div>

<details>
<summary>Data sources and run history</summary>

<br>

<img src="docs/assets/queryforge-studio-sources.png" width="100%" alt="QueryForge data source summary, searchable table inventory, and atomic publication workflow">

Data Sources keeps the physical inventory and semantic publication steps together.
CSV and Parquet uploads open the review wizard inside the active domain.

<img src="docs/assets/queryforge-studio-runs.png" width="100%" alt="QueryForge run history with status filters, question search, demo labels, and JSON history export">

Run History supports question and run ID search, status filters, replay, and JSON
export of the active domain's history. Failed and blocked outcomes stay visible.

</details>

## Why QueryForge?

Most NL2SQL demos stop after a model emits a query. QueryForge covers the full
Expand Down Expand Up @@ -138,6 +165,19 @@ Streaming example or create a clean domain, then add data inside that domain. If
the Python API is offline, the sample-domain analysis remains explorable with a
deterministic demo response. See the [Studio guide](docs/studio.md).

The desktop workflow is:

1. **Data Domains**: select the sample or create your own business context.
2. **Data Sources**: upload CSV or Parquet, inspect the profile, review the semantic
contract, and publish. The bundled sample model is read only in Studio.
3. **Semantic Studio**: find entities and metrics and inspect reviewed Join Paths.
4. **Ask & Analyze**: ask a question, switch between a chart and table, and inspect
the SQL and Trust Trace. Live answers require the Python API and a configured provider.
5. **Run History**: search, filter, export, or replay saved runs in the same domain.

Use the sun or moon control in the top bar to switch themes. Studio remembers the
choice in this browser. Dialogs support keyboard focus navigation and **Esc** to close.

## How It Works

<div align="center">
Expand Down
50 changes: 44 additions & 6 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,52 @@ NL2SQL、AST 级安全策略、只读执行、有界修复和完整运行产物

## 产品界面

Studio 面向 PC 端数据分析,提供固定侧栏、统一数据域切换和可保存的明暗主题。
以下截图来自实际运行的本地界面,桌面视口为 **1440 × 1000**,展示内置的
Anime Streaming 合成样例。分析结果和运行历史均保留 **DEMO** 标记,不代表真实模型运行。

<div align="center">
<img src="docs/assets/queryforge-studio-domains.png" width="100%" alt="QueryForge 数据域中心:创建和选择相互隔离的业务上下文">
<sub>数据域中心——先创建或选择治理边界,再接入该域的数据与语义。</sub>
<sub>数据域中心 · 创建或选择业务上下文,清晰呈现从数据接入到分析的操作路径。</sub>
</div>

<br>

<div align="center">
<img src="docs/assets/queryforge-studio-overview.png" width="100%" alt="QueryForge Studio 总览:语义契约健康度、业务指标与互动趋势">
<sub>数据域总览——Anime Streaming 只是当前选中的示例域,不再是平台身份。</sub>
<sub>深色总览 · 从业务问题出发,查看样例指标和契约状态,进入对应工作区。</sub>
</div>

<br>

<div align="center">
<img src="docs/assets/queryforge-studio-semantic.png" width="49%" alt="QueryForge Semantic Studio 实体关系图和契约编辑器">
<img src="docs/assets/queryforge-studio-analysis.png" width="49%" alt="QueryForge 受治理分析结果、生成 SQL 与 Trust Trace">
<br>
<sub>语义建模工作台 &nbsp;·&nbsp; 带可审计 SQL 和 Trust Trace 的受治理分析</sub>
<img src="docs/assets/queryforge-studio-semantic.png" width="100%" alt="QueryForge 语义工作台:实体搜索、自动适配画布的关系图和只读样例契约检查器">
<sub>语义工作台 · 搜索实体和指标,缩放关系图,查看样例契约与业务定义。</sub>
</div>

<br>

<div align="center">
<img src="docs/assets/queryforge-studio-analysis.png" width="100%" alt="QueryForge PC 分析界面:样例回答、结果图表、生成 SQL 和明确标识来源的 Trust Trace">
<sub>分析工作区 · 并排查看图表与 SQL,右侧逐项检查证据,演示来源始终可见。</sub>
</div>

<details>
<summary>查看数据源与运行历史</summary>

<br>

<img src="docs/assets/queryforge-studio-sources.png" width="100%" alt="QueryForge 数据源概览、可搜索的物理表清单和原子发布流程">

数据源页面集中展示物理表清单与语义发布步骤。上传 CSV 或 Parquet 后,在当前数据域内完成评审。

<img src="docs/assets/queryforge-studio-runs.png" width="100%" alt="QueryForge 运行历史:状态筛选、问题搜索、演示标识和 JSON 历史导出">

运行历史支持按问题和运行 ID 搜索、状态筛选、结果回放,以及当前数据域历史的 JSON 导出。
失败和被策略拦截的结果保留原有状态。

</details>

## 为什么是 QueryForge?

大多数 NL2SQL Demo 在模型输出查询后就结束了,QueryForge 关注的是完整交付链路:
Expand Down Expand Up @@ -133,6 +158,19 @@ make web-dev
示例域,也可创建一个完全空白的新域,然后只在当前域内上传数据。Python API 离线时,
示例域分析会使用确定性的演示结果。详见 [Studio 使用指南](docs/studio.md)。

PC 端的主要操作路径:

1. **Data Domains**:选择样例或创建自己的业务数据域。
2. **Data Sources**:上传 CSV 或 Parquet,检查采样结果、评审语义契约并发布。
内置样例模型在 Studio 中只读。
3. **Semantic Studio**:搜索实体和指标,查看业务口径及已评审的 Join Path。
4. **Ask & Analyze**:发起分析,切换图表与表格,检查 SQL 和 Trust Trace。
真实模型分析需要 Python API 和已配置的 Provider。
5. **Run History**:搜索、筛选、导出或回放当前数据域的历史结果。

顶部的太阳或月亮按钮可切换明暗主题,偏好保存在当前浏览器。弹窗支持键盘焦点导航,
按 **Esc** 关闭并返回触发按钮。

## 系统架构

<div align="center">
Expand Down
Binary file modified docs/assets/queryforge-studio-analysis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/queryforge-studio-domains.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/queryforge-studio-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/queryforge-studio-runs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/queryforge-studio-semantic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/queryforge-studio-sources.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions docs/studio.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,26 @@ make web-dev
Open <http://localhost:3000>. Studio supports local single-user use.
Demo results are labelled explicitly; a failed live request cannot become a demo success.

## Desktop workspace

Studio uses a persistent sidebar and a shared top bar for the active data domain,
backend connection, appearance and runtime information. The sun or moon control
switches light and dark themes; the choice is saved in the current browser.
Geist text and Geist Mono code fonts are bundled with the application.

- Data Sources filters the displayed sample table inventory by table name.
- Semantic Studio searches entities and metrics. The relationship graph fits its
available width and supports zoom and fit controls. The bundled sample model
is read only; author model changes in YAML or review uploaded data in the wizard.
- Ask & Analyze offers chart and table views, with SQL and Trust Trace beside the
result on wide desktop windows. Loading placeholders do not assert progress.
- Run History searches questions and run IDs, filters by status, and exports the
active domain's history as JSON.

Keyboard users can skip to the workspace. Dialogs keep focus inside, support
Escape to close, and return focus to the trigger. See the [desktop screenshot
gallery](../README.md#product-tour).

For live execution, start the Python API in another terminal:

```bash
Expand Down
12 changes: 11 additions & 1 deletion web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The domain-first visual workspace for QueryForge. Users create or select a data
domain, then onboard that domain's sources, build its mandatory semantic
contract, run governed analysis, inspect SQL and trust evidence, and audit
domain-scoped history in one responsive interface.
domain-scoped history in one desktop workspace.

## Run locally

Expand Down Expand Up @@ -42,6 +42,16 @@ profiling, actual publication, snapshot expiry and reproducible offline checks.
export, and a complete Trust Trace.
- **Run History** — filterable, domain-scoped history for audit and replay.

The top bar includes a persistent light/dark appearance preference. Entity,
metric, table and history searches operate locally on the displayed records;
the relationship graph fits its available width. The bundled sample model is
read only. Dialogs support keyboard focus navigation and Escape to close.

The [product tour](../README.md#product-tour) shows actual desktop screenshots.
Shared palette roles, spacing, radii and named text styles live in
`app/design-system.css`; workspace layouts and component states live in
`app/globals.css`.

Data uploads are intentionally atomic: the upload endpoint refuses publication
until a data domain is selected and its semantic contract has been reviewed and
validated.
Expand Down
174 changes: 174 additions & 0 deletions web/app/design-system.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
/* Shared foundations: palette → semantic roles → components. */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 400; font-display: swap; src: url("../node_modules/@fontsource/geist/files/geist-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 500; font-display: swap; src: url("../node_modules/@fontsource/geist/files/geist-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 600; font-display: swap; src: url("../node_modules/@fontsource/geist/files/geist-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../node_modules/@fontsource/geist-mono/files/geist-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../node_modules/@fontsource/geist-mono/files/geist-mono-latin-500-normal.woff2") format("woff2"); }

:root {
--core-neutral-00: #ffffff;
--core-neutral-50: #f6f7f6;
--core-neutral-100: #eceeec;
--core-neutral-200: #d8ddd9;
--core-neutral-300: #bfc8c2;
--core-neutral-400: #a6b0a9;
--core-neutral-450: #9b9b9b;
--core-neutral-500: #7b857e;
--core-neutral-600: #626b65;
--core-neutral-650: #666666;
--core-neutral-700: #465149;
--core-neutral-750: #313131;
--core-neutral-800: #272727;
--core-neutral-850: #1f1f1f;
--core-neutral-870: #181818;
--core-neutral-1000: #000000;
--core-primary-50: #edf5ef;
--core-primary-100: #dcebe1;
--core-primary-200: #c5ddce;
--core-primary-300: #acd1bb;
--core-primary-400: #91bda2;
--core-primary-500: #76a68a;
--core-primary-600: #568468;
--core-primary-700: #3f6c50;
--core-primary-800: #2e533d;
--core-primary-900: #203e2d;
--core-primary-1000: #172b20;
--core-red-100: #fbe8e7;
--core-red-300: #f1b1ac;
--core-red-700: #a13330;
--core-yellow-100: #faf0dd;
--core-yellow-300: #e7c38b;
--core-yellow-700: #825919;

--spacing-0: 0px;
--spacing-25: 2px;
--spacing-50: 4px;
--spacing-75: 8px;
--spacing-100: 12px;
--spacing-200: 16px;
--spacing-300: 24px;
--spacing-400: 32px;
--spacing-500: 40px;
--spacing-600: 48px;
--spacing-700: 64px;
--spacing-800: 80px;
--spacing-900: 96px;
--radius-0: 0px;
--radius-2: 2px;
--radius-4: 4px;
--radius-6: 6px;
--radius-8: 8px;
--radius-12: 12px;
--radius-16: 16px;
--radius-24: 24px;
--radius-full: 9999px;
--font-sans: "Geist", system-ui, sans-serif;
--font-mono: "Geist Mono", ui-monospace, monospace;
--heading-1: 600 60px/60px var(--font-sans);
--heading-2: 600 48px/48px var(--font-sans);
--heading-3: 600 36px/40px var(--font-sans);
--heading-4: 600 30px/36px var(--font-sans);
--heading-5: 600 24px/32px var(--font-sans);
--heading-6: 600 20px/28px var(--font-sans);
--title-1: 500 20px/28px var(--font-sans);
--title-2: 500 18px/28px var(--font-sans);
--title-3: 500 16px/24px var(--font-sans);
--title-4: 500 14px/20px var(--font-sans);
--title-5: 500 12px/16px var(--font-sans);
--body-1: 600 16px/24px var(--font-sans);
--body-2: 500 16px/24px var(--font-sans);
--body-3: 400 16px/24px var(--font-sans);
--body-4: 600 14px/20px var(--font-sans);
--body-5: 500 14px/20px var(--font-sans);
--body-6: 400 14px/20px var(--font-sans);
--button-lg: 600 18px/28px var(--font-sans);
--button-md: 600 16px/24px var(--font-sans);
--button-sm: 600 14px/20px var(--font-sans);
--button-xsm: 600 12px/16px var(--font-sans);
--caption-1: 500 14px/20px var(--font-sans);
--caption-2: 400 14px/20px var(--font-sans);
--caption-3: 600 12px/16px var(--font-sans);
--caption-4: 500 12px/16px var(--font-sans);
--caption-5: 400 12px/16px var(--font-sans);
--motion-curve: cubic-bezier(0.22, 1, 0.36, 1);

color-scheme: dark;
--bg: var(--core-neutral-870);
--bg-soft: var(--core-neutral-870);
--surface: var(--core-neutral-850);
--surface-raised: var(--core-neutral-800);
--surface-hover: var(--core-neutral-750);
--border: var(--core-neutral-500);
--border-subtle: var(--core-neutral-750);
--text: var(--core-neutral-50);
--text-secondary: var(--core-neutral-200);
--text-muted: var(--core-neutral-400);
--action-primary: var(--core-primary-300);
--action-primary-hover: var(--core-primary-200);
--surface-selected: var(--core-neutral-800);
--action-text: var(--core-primary-1000);
--text-accent: var(--core-primary-300);
--text-tertiary: var(--core-neutral-300);
--text-warning: var(--core-yellow-300);
--text-error: var(--core-red-300);
--error-subtle: var(--core-neutral-800);
--warning-subtle: var(--core-neutral-800);
--overlay: rgb(0 0 0 / 64%);
--shadow: 0 24px 64px rgb(0 0 0 / 20%);
--heading-start: var(--core-neutral-00);
--heading-end: var(--core-neutral-450);
}

:root[data-theme="light"] {
color-scheme: light;
--bg: var(--core-neutral-50);
--bg-soft: var(--core-neutral-50);
--surface: var(--core-neutral-00);
--surface-raised: var(--core-neutral-100);
--surface-hover: var(--core-neutral-200);
--border: var(--core-neutral-500);
--border-subtle: var(--core-neutral-200);
--text: var(--core-neutral-870);
--text-secondary: var(--core-neutral-700);
--text-muted: var(--core-neutral-600);
--action-primary: var(--core-primary-800);
--action-primary-hover: var(--core-primary-900);
--surface-selected: var(--core-primary-50);
--action-text: var(--core-neutral-00);
--text-accent: var(--core-primary-800);
--text-tertiary: var(--core-neutral-700);
--text-warning: var(--core-yellow-700);
--text-error: var(--core-red-700);
--error-subtle: var(--core-red-100);
--warning-subtle: var(--core-yellow-100);
--shadow: 0 24px 64px rgb(0 0 0 / 8%);
--heading-start: var(--core-neutral-1000);
--heading-end: var(--core-neutral-650);
}

.heading-1 { font: var(--heading-1); }
.heading-2 { font: var(--heading-2); }
.heading-3 { font: var(--heading-3); }
.heading-4 { font: var(--heading-4); }
.heading-5 { font: var(--heading-5); }
.heading-6 { font: var(--heading-6); }
.title-1 { font: var(--title-1); }
.title-2 { font: var(--title-2); }
.title-3 { font: var(--title-3); }
.title-4 { font: var(--title-4); }
.title-5 { font: var(--title-5); }
.body-1 { font: var(--body-1); }
.body-2 { font: var(--body-2); }
.body-3 { font: var(--body-3); }
.body-4 { font: var(--body-4); }
.body-5 { font: var(--body-5); }
.body-6 { font: var(--body-6); }
.button-lg { font: var(--button-lg); }
.button-md { font: var(--button-md); }
.button-sm { font: var(--button-sm); }
.button-xsm { font: var(--button-xsm); }
.caption-1 { font: var(--caption-1); }
.caption-2 { font: var(--caption-2); }
.caption-3 { font: var(--caption-3); }
.caption-4 { font: var(--caption-4); }
.caption-5 { font: var(--caption-5); }
Loading
Loading