Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
63 changes: 39 additions & 24 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,59 @@
# Changelog / 更新记录

## V0.1.0 Release Candidate
## V0.1.0 — 2026-09-19

English:

* Added V0.1 specification and modular local first architecture.
* Added schema builder domain and JSON Schema generation.
* Added deterministic validation for required, type, regex, numeric range, strict ISO calendar dates, boolean rules, and unexpected output fields.
* Added BYOK adapters for OpenAI, Anthropic, and Gemini, including OpenAI `store: false` and Gemini `responseJsonSchema`.
* Added PDF.js text extraction and Tesseract.js local OCR fallback.
* Added human correction state, provenance fields, and local eval metrics.
* Added IndexedDB project storage and portable project backup and restore.
* Added JSON, CSV, and XLSX export.
* Added React review workspace and Cloudflare Pages deployment configuration.
* Added dependency free domain, Vitest, persistence, component, TypeScript, production build, and Playwright smoke verification.
* Added the V0.1 specification and modular Local First architecture.
* Added browser-side PDF.js text extraction and Tesseract.js OCR fallback for scans and images.
* Added schema building for string, number, date, and boolean fields, plus Required, regex, minimum, maximum, strict ISO date, malformed output, and unknown-field validation.
* Added provider-independent extraction orchestration with BYOK adapters for OpenAI, Anthropic, Gemini, and Qwen.
* Added explicit Qwen region routing for China (Beijing), Singapore, and Hong Kong (China), with no automatic cross-region fallback.
* Added provider verification metadata. Qwen is V0.1 Live Verified; OpenAI, Anthropic, and Gemini remain Experimental until their own real API smoke tests pass.
* Rechecked the V0.1 default model IDs against official provider documentation on 2026-09-19: `gpt-5.6-luna`, `claude-sonnet-5`, `gemini-3.8-flash`, and `qwen3.8-max`.
* Added deterministic local validation immediately after AI prediction and after human correction.
* Added Human-in-the-Loop Review that preserves AI Prediction, Final Value, correction state, validation result, provider, model, region, and processing timestamp.
* Added JSON, CSV, and XLSX export from Final Value.
* Added IndexedDB autosave and startup restoration of the most recently updated project.
* Fixed startup hydration so a new blank project cannot autosave before IndexedDB restoration completes.
* Added versioned portable JSON backup and restore. API keys and original binary documents remain excluded.
* Added local eval metrics derived from validation and human correction state.
* Added React review workspace, Vitest, dependency-free domain tests, TypeScript typecheck, production build verification, and Playwright Chromium smoke tests.
* Deployed the public V0.1 build through Cloudflare Workers + Static Assets at `https://flowextract.edwardxie421.workers.dev`.
* Completed a real production Qwen China (Beijing) smoke test with a fictional invoice: extraction, structured output, validation, human correction, revalidation, JSON/CSV/XLSX export, IndexedDB reload, and Backup/Restore all passed. The API key was not persisted or included in the backup.

中文:

* 建立 V0.1 SPEC 和模块化 Local First 架构。
* 建立 Schema 域模型和 JSON Schema 生成。
* 建立 Required、类型、正则、数字范围、严格 ISO 日期、布尔值和未知输出字段确定性验证。
* 建立 OpenAI、Anthropic、Gemini BYOK 适配器,包括 OpenAI `store: false` 和 Gemini `responseJsonSchema`。
* 建立 PDF.js 文本提取和 Tesseract.js 本地 OCR fallback。
* 建立人工修订状态、provenance 字段和本地 Evals。
* 建立 IndexedDB 项目存储与便携备份恢复。
* 建立 JSON、CSV、XLSX 导出。
* 建立 React Review 工作区和 Cloudflare Pages 部署配置。
* 建立无依赖核心域、Vitest、持久化、组件、TypeScript、生产构建和 Playwright smoke 验证。
* 建立浏览器端 PDF.js 文本提取,以及扫描件和图片的 Tesseract.js OCR fallback。
* 建立 String、Number、Date、Boolean Schema,以及 Required、Regex、Minimum、Maximum、严格 ISO 日期、Malformed Output、Unknown Fields 验证。
* 建立与 Provider 无关的 Extraction 编排,并接入 OpenAI、Anthropic、Gemini、Qwen BYOK Adapter。
* 建立 Qwen 中国大陆(北京)、新加坡、中国香港显式地域路由,禁止自动跨地域 fallback。
* 建立 Provider Verification Metadata。Qwen 在 V0.1 中为 Live Verified;OpenAI、Anthropic、Gemini 在各自真实 API Smoke Test 完成前保持 Experimental。
* 2026-09-19 根据官方文档重新核对 V0.1 默认模型 ID:`gpt-5.6-luna`、`claude-sonnet-5`、`gemini-3.8-flash`、`qwen3.8-max`。
* AI Prediction 生成后立即执行本地确定性 Validation,人工修订后基于 Final Value 重新 Validation。
* 建立 Human-in-the-Loop Review,保留 AI Prediction、Final Value、Correction、Validation、Provider、Model、Region 和处理时间。
* JSON、CSV、XLSX 均使用 Final Value 导出。
* 建立 IndexedDB 自动保存,并在启动时恢复最近更新项目。
* 修复启动 Hydration 竞态,避免 IndexedDB 恢复完成前保存空白新项目。
* 建立版本化 Project Backup / Restore;API Key 和原始二进制文档均不进入备份。
* 建立基于 Validation 和 Human Correction 的本地 Evals。
* 建立 React Review 工作区、无依赖 Domain Tests、Vitest、TypeScript Typecheck、Production Build 和 Playwright Chromium Smoke。
* 公共 V0.1 使用 Cloudflare Workers + Static Assets 部署:`https://flowextract.edwardxie421.workers.dev`。
* 已使用虚构 Invoice 在生产环境完成 Qwen 中国大陆(北京)真实 Smoke Test:Extraction、Structured Output、Validation、Human Correction、Revalidation、JSON/CSV/XLSX、IndexedDB Reload、Backup/Restore 全部通过;API Key 未持久化,也未进入 Backup。

### Verification / 验证

GitHub Actions now performs the full V0.1 release gate on Node.js 22:
The final release gate requires and has automated coverage for:

1. Dependency free domain tests.
1. Dependency-free domain tests.
2. Reproducible dependency install with `npm ci`.
3. Vitest suite.
4. TypeScript project typecheck.
5. Vite production build.
6. Playwright Chromium smoke test.
7. Cloudflare Workers production build.

The full gate passed on the public `main` branch during release preparation on September 18, 2026.
The production BYOK smoke test is manual by design because FlowExtract does not persist provider credentials in the repository, CI, IndexedDB, or backup files.

GitHub Actions 现在使用 Node.js 22 执行完整 V0.1 发布门禁,包括核心域测试、`npm ci`、Vitest、TypeScript 类型检查、Vite 生产构建和 Playwright Chromium smoke。2026 年 9 月 18 日公开仓库 `main` 分支已通过完整流程。
最终发布门禁包含无依赖 Domain Tests、`npm ci`、Vitest、TypeScript Typecheck、Vite Production Build、Playwright Chromium Smoke 和 Cloudflare Workers Production Build。真实 BYOK Smoke Test 保持人工执行,因为 FlowExtract 不在仓库、CI、IndexedDB 或 Backup 中保存 Provider 凭据。
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ FlowExtract is an open source browser application for turning PDFs and document

The review step is the product focus. AI makes the first prediction. Deterministic rules identify missing, malformed, or out of range values. The user sees the source alongside the predicted and final values and corrects only what needs attention.

## Current V0.1 development scope
## V0.1 scope

Supported input targets:

Expand All @@ -23,7 +23,7 @@ Supported input targets:

Schema fields support `string`, `number`, `date`, and `boolean`, plus required fields, regex patterns, and numeric minimum and maximum rules.

BYOK provider adapters are included for OpenAI, Anthropic, Gemini, and Qwen (Alibaba Cloud Model Studio). Model names are editable because provider model lifecycles change independently from FlowExtract. Provider availability is tracked separately from adapter implementation: until a real API smoke test passes, a provider remains marked Experimental even when its contract tests pass.
BYOK provider adapters are included for OpenAI, Anthropic, Gemini, and Qwen (Alibaba Cloud Model Studio). Model names are editable because provider model lifecycles change independently from FlowExtract. Qwen is live-verified for V0.1 against Alibaba Cloud Model Studio in China (Beijing). OpenAI, Anthropic, and Gemini remain Experimental: their adapters and contract tests are included, but a real API smoke test has not been completed for this release.

Exports include JSON, CSV, and XLSX. Project state is stored in IndexedDB. Portable JSON backup and restore are included.

Expand Down Expand Up @@ -79,29 +79,31 @@ npm run test:e2e

`npm run test:domain` runs dependency free Node 22 domain tests. It remains usable when package installation is unavailable.

## Cloudflare Pages deployment
## Cloudflare Workers deployment

FlowExtract requires no runtime server.

Use these Pages settings:
FlowExtract requires no application backend. The public V0.1 deployment uses Cloudflare Workers + Static Assets with Git integration.

```text
Production branch: main
Build command: npm run build
Build output directory: dist
Deploy command: npx wrangler deploy
Static assets: ./dist
Node version: 22
```

A free `pages.dev` subdomain is enough for the first public MVP. Do not add a paid domain, database, server, or FlowExtract funded AI account before product validation requires it.
Production: `https://flowextract.edwardxie421.workers.dev`

The repository `wrangler.jsonc` configures `./dist` as SPA static assets. V0.1 stays on the free `workers.dev` hostname and does not add a paid domain, database, server-side AI proxy, or FlowExtract-funded AI account.

## Provider notes

Default model strings are convenience values only and are editable in the UI.
Default model strings are convenience values only and are editable in the UI. The V0.1 defaults were rechecked against official provider documentation on 2026-09-19: `gpt-5.6-luna`, `claude-sonnet-5`, `gemini-3.8-flash`, and `qwen3.8-max`.

OpenAI uses the Responses API with structured JSON output and requests `store: false`. Anthropic uses the Messages API and structured output. The browser adapter includes Anthropic's direct browser access header. Gemini uses `generateContent` with `responseJsonSchema`. Qwen uses Alibaba Cloud Model Studio's OpenAI-compatible Chat Completions interface with strict JSON Schema output. Qwen region selection is explicit; FlowExtract does not automatically retry a document in another region.

Browser BYOK is a deliberate V0.1 tradeoff for a zero backend, user controlled tool. The key is never embedded in the application and is cleared on reload, but it is still accessible to the page runtime while entered. OpenAI and Google both recommend keeping long lived production API keys on a server. For V0.1 testing, use a dedicated provider key with the smallest practical permissions, quota, and spend limits. A future hardened option can use a user run local companion or provider specific short lived authorization when available.

Provider APIs can change. Verify current provider documentation before a release.
Provider APIs can change. Recheck current provider documentation before each release. A valid model ID does not imply that FlowExtract has completed a live API smoke test for that provider.

## Known V0.1 limitations

Expand All @@ -118,6 +120,8 @@ Provider APIs can change. Verify current provider documentation before a release
* `CONTRIBUTING.md`
* `SECURITY.md`
* `CHANGELOG.md`
* `docs/deployment-cloudflare-workers.md`
* `docs/release-v0.1.md`

## License

Expand Down
26 changes: 17 additions & 9 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Review 是产品重点。AI 先给出预测,确定性 Validation Rules 检查

Schema 支持 `string`、`number`、`date`、`boolean`,并支持 Required、正则格式、数字最小值和最大值。

BYOK Provider 已建立 OpenAI、Anthropic、Gemini、Qwen(阿里云百炼 / Model Studio)适配器。模型名称可以直接编辑,避免 Provider 更新模型后必须重新发布 FlowExtract。Provider 的“代码已适配”和“真实 API 已验证”分开记录:即使 Contract Tests 已通过,在真实 API Smoke Test 成功前仍标记为 Experimental。
BYOK Provider 已建立 OpenAI、Anthropic、Gemini、Qwen(阿里云百炼 / Model Studio)适配器。模型名称可以直接编辑,避免 Provider 更新模型后必须重新发布 FlowExtract。Qwen 已在 V0.1 中使用阿里云百炼中国大陆(北京)地域完成真实 API 端到端验证。OpenAI、Anthropic、Gemini 仍标记为 Experimental:适配器和 Contract Tests 已具备,但本次 Release 尚未完成真实 API Smoke Test。

导出支持 JSON、CSV、XLSX。项目数据保存在 IndexedDB,同时提供可移植 JSON 项目备份和恢复。

Expand Down Expand Up @@ -79,29 +79,31 @@ npm run test:e2e

`npm run test:domain` 使用 Node 22 执行无依赖核心域测试,在 npm 依赖暂时无法安装时仍可运行。

## Cloudflare Pages 免费部署
## Cloudflare Workers 免费部署

FlowExtract 不需要运行时服务器。

Pages 配置:
FlowExtract 不需要应用后端。V0.1 公共环境实际使用 Cloudflare Workers + Static Assets,并通过 Git 集成自动部署。

```text
Production branch: main
Build command: npm run build
Build output directory: dist
Deploy command: npx wrangler deploy
Static assets: ./dist
Node version: 22
```

第一阶段使用免费的 `pages.dev` 子域即可。在产品得到真实验证以前,不购买域名、数据库、服务器,也不使用 FlowExtract 自己承担费用的 AI 账户。
生产地址:`https://flowextract.edwardxie421.workers.dev`

仓库中的 `wrangler.jsonc` 把 `./dist` 配置为 SPA 静态资源。V0.1 继续使用免费的 `workers.dev` 地址,不增加付费域名、数据库、服务端 AI 代理或 FlowExtract 自己承担费用的 AI 账户。

## Provider 说明

UI 中的默认模型名称只是便利默认值,用户可以修改。
UI 中的默认模型名称只是便利默认值,用户可以修改。V0.1 默认模型 ID 已于 2026-09-19 根据各 Provider 官方文档重新核对:`gpt-5.6-luna`、`claude-sonnet-5`、`gemini-3.8-flash`、`qwen3.8-max`。

OpenAI 使用 Responses API 的结构化 JSON 输出,并显式发送 `store: false`。Anthropic 使用 Messages API 和 structured output,并在浏览器适配器中加入其浏览器直连 Header。Gemini 使用 `generateContent` 和 `responseJsonSchema`。Qwen 使用阿里云 Model Studio 的 OpenAI-compatible Chat Completions 和严格 JSON Schema 输出。Qwen Region 必须由用户明确选择;某个地域失败时,FlowExtract 不会把文档自动重试到其他地域。

浏览器 BYOK 是 V0.1 在零后端约束下采用的明确取舍。API Key 不会嵌入应用,也会在刷新页面后清除,但输入期间页面运行时仍可以访问该 Key。OpenAI 和 Google 的官方安全说明都建议生产环境的长期 API Key 放在服务端。V0.1 测试应使用独立 Provider Key,并尽量限制权限、额度和消费上限。后续可增加由用户自己运行的本地 companion,或在 Provider 支持时采用短期授权。

Provider API 会变化,正式 Release 前需要再次核对官方文档。
Provider API 会变化,每次 Release 前都需要重新核对官方文档。模型 ID 有效并不等于 FlowExtract 已完成该 Provider 的真实 API Smoke Test。

## V0.1 已知限制

Expand All @@ -114,3 +116,9 @@ Provider API 会变化,正式 Release 前需要再次核对官方文档。
## 许可证

MIT


## 部署与发布文档

* `docs/deployment-cloudflare-workers.md`
* `docs/release-v0.1.md`
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Do not open a public issue containing API keys, private documents, credentials,

## V0.1 trust boundary / V0.1 信任边界

FlowExtract has no application backend. Documents are parsed locally. Parsed text is sent directly to the user's selected AI provider only when the user starts extraction. API keys remain in volatile browser state and must never enter IndexedDB, backups, logs, fixtures, screenshots, or repository files.
FlowExtract has no application backend. Documents are parsed locally. Parsed text is sent directly to the user's selected AI provider only when the user starts extraction. For Qwen, the user explicitly selects the provider region and FlowExtract never automatically retries the same document in another region after failure. API keys remain in volatile browser state and must never enter IndexedDB, backups, logs, fixtures, screenshots, or repository files.

FlowExtract 没有应用后端。文档在本地解析。只有用户主动执行提取时,解析后的文本才会直接发送给用户选择的 AI Provider。API Key 只能存在于浏览器临时状态,禁止进入 IndexedDB、备份、日志、测试 fixtures、截图和仓库文件。
FlowExtract 没有应用后端。文档在本地解析。只有用户主动执行提取时,解析后的文本才会直接发送给用户选择的 AI Provider。Qwen 地域由用户明确选择,FlowExtract 不会在请求失败后自动把同一文档重试到其他地域。API Key 只能存在于浏览器临时状态,禁止进入 IndexedDB、备份、日志、测试 fixtures、截图和仓库文件。

## Logging / 日志

Expand Down
62 changes: 0 additions & 62 deletions docs/deployment-cloudflare-pages.md

This file was deleted.

Loading
Loading