From 962e93b1bda369d2f5b5b428c6b3f23fd741fd5f Mon Sep 17 00:00:00 2001 From: Pama-Lee Date: Fri, 17 Apr 2026 17:29:02 +0800 Subject: [PATCH] docs(vitepress): reframe docs around decision platform vision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Homepage hero: "Open-Source Decision Platform" tagline - Features: Platform/Studio/Test Management first, engine performance fourth - Remove performance table from homepage (detail lives in reference/benchmarks) - what-is-ordo: full rewrite — 3-layer architecture, lifecycle table, platform framing - Both en and zh locales updated --- .../apps/docs/en/guide/what-is-ordo.md | 102 ++++++----------- ordo-editor/apps/docs/en/index.md | 43 +++---- .../apps/docs/zh/guide/what-is-ordo.md | 106 +++++++----------- ordo-editor/apps/docs/zh/index.md | 43 +++---- 4 files changed, 108 insertions(+), 186 deletions(-) diff --git a/ordo-editor/apps/docs/en/guide/what-is-ordo.md b/ordo-editor/apps/docs/en/guide/what-is-ordo.md index fa456ff9..60584c72 100644 --- a/ordo-editor/apps/docs/en/guide/what-is-ordo.md +++ b/ordo-editor/apps/docs/en/guide/what-is-ordo.md @@ -1,86 +1,56 @@ # What is Ordo? -**Ordo** (Latin for "order") is an enterprise-grade rule engine designed for extreme performance and reliability. Built entirely in Rust, it evaluates business rules with **sub-microsecond latency** and supports **500,000+ executions per second**. +**Ordo** (Latin for "order") is an open-source decision platform for teams who need to **own their decision logic** — not scatter it across codebases, spreadsheets, and tribal knowledge. -## Key Features +It has three layers: -### Visual Rule Editor +- **Engine** — sub-microsecond rule execution, JIT-compiled via Cranelift, runs everywhere (HTTP · gRPC · WASM · CLI). +- **Platform** — org and project management, fact catalog, decision contracts, version history, rule templates. +- **Studio** — visual flow editor, test case management, one-click template instantiation. -Design complex business rules with an intuitive drag-and-drop flow editor: +## Why a Decision Platform? -- **Flow View**: Visualize rule logic as connected decision trees -- **Form View**: Edit conditions and actions with a structured form interface -- **Real-time Execution**: Test rules instantly with WASM-powered execution -- **Execution Trace**: Debug step-by-step with visual path highlighting +Most teams start with a rule engine. Then they realize the hard part isn't execution speed — it's knowing what rules exist, who changed them, whether they still work, and how to hand them off to a new engineer. -### Blazing Fast Performance +Ordo addresses the full lifecycle: -- **1.63 µs** average rule execution time -- **600x faster** than the 1ms target -- Zero-allocation hot path -- Pre-compiled expression evaluation - -### Flexible Rule Definition - -- **Step Flow Model**: Linear decision steps with conditional jumps -- **Rich Expressions**: Comparisons, logical operators, functions, conditionals -- **Built-in Functions**: `len()`, `sum()`, `avg()`, `upper()`, `lower()`, `abs()`, `min()`, `max()` -- **Field Coalescing**: `coalesce(field, fallback, default)` for missing field handling - -### Production Ready - -- **Deterministic Execution**: Same input → Same path → Same result -- **Execution Tracing**: Full visibility into every step for debugging -- **Hot Reload**: Update rules without service restart -- **Audit Logging**: Track all rule changes and executions - -### Easy Integration - -- **HTTP REST API**: Simple JSON-based interface -- **WebAssembly**: Run rules directly in browser -- **gRPC Support**: High-performance binary protocol +| Stage | What Ordo provides | +|-------|--------------------| +| **Author** | Studio flow editor, decision tables, template library | +| **Test** | Per-ruleset test cases, run in CI, export to YAML | +| **Govern** | Fact catalog, typed contracts, version history, audit log | +| **Execute** | Fast engine, hot reload, multi-tenancy | +| **Observe** | Execution traces, Prometheus metrics, structured logs | ## Architecture -Ordo consists of several components: - ``` ┌─────────────────────────────────────────────────────────────┐ -│ Visual Editor (Vue 3) │ -│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │ -│ │ Flow View │ │ Form View │ │ Execution Trace │ │ -│ └─────────────┘ └─────────────┘ └─────────────────────┘ │ -└─────────────────────────────────────────────────────────────┘ - │ - ▼ -┌─────────────────────────────────────────────────────────────┐ -│ ordo-wasm (WASM) │ -│ Browser-side rule execution │ -└─────────────────────────────────────────────────────────────┘ - -┌─────────────────────────────────────────────────────────────┐ -│ ordo-server (Rust) │ -│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌───────────────┐ │ -│ │ HTTP │ │ gRPC │ │ UDS │ │ Rule Store │ │ -│ └─────────┘ └─────────┘ └─────────┘ └───────────────┘ │ -└─────────────────────────────────────────────────────────────┘ - │ - ▼ -┌─────────────────────────────────────────────────────────────┐ +│ Platform (ordo-platform) │ +│ Org · Project · Fact Catalog · Contracts · Templates · Tests│ +└──────────────────────────┬──────────────────────────────────┘ + │ +┌──────────────────────────▼──────────────────────────────────┐ +│ Studio (apps/studio) │ +│ Flow Editor · Test Runner · Template Library │ +└──────────────────────────┬──────────────────────────────────┘ + │ +┌──────────────────────────▼──────────────────────────────────┐ +│ Engine (ordo-server) │ +│ HTTP REST · gRPC · Unix Socket · Prometheus metrics │ +└──────────────────────────┬──────────────────────────────────┘ + │ +┌──────────────────────────▼──────────────────────────────────┐ │ ordo-core (Rust) │ -│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │ -│ │ Executor │ │ Evaluator │ │ Expression Parser │ │ -│ └─────────────┘ └─────────────┘ └─────────────────────┘ │ +│ Interpreter · Bytecode VM · Cranelift JIT · WASM │ └─────────────────────────────────────────────────────────────┘ ``` ## Use Cases -Ordo is ideal for: +Ordo is a good fit whenever business logic needs to be **visible, testable, and changeable** without a full deploy: -- **Risk Assessment**: Credit scoring, fraud detection, KYC checks -- **Pricing Rules**: Dynamic pricing, discount calculations, promotions -- **Eligibility Checks**: Loan approval, insurance underwriting -- **Routing Logic**: Order routing, load balancing decisions -- **Compliance Rules**: Regulatory checks, policy enforcement -- **Feature Flags**: A/B testing, gradual rollouts +- **Risk & compliance** — credit scoring, fraud detection, KYC, regulatory policy +- **Pricing & promotions** — dynamic pricing, discount rules, campaign eligibility +- **Routing & assignment** — order routing, payment channel selection, load decisions +- **Access & eligibility** — loan approval, feature flags, subscription tier logic diff --git a/ordo-editor/apps/docs/en/index.md b/ordo-editor/apps/docs/en/index.md index 3c0ffc07..ed9c1c14 100644 --- a/ordo-editor/apps/docs/en/index.md +++ b/ordo-editor/apps/docs/en/index.md @@ -3,8 +3,8 @@ layout: home hero: name: 'Ordo' - text: 'High-Performance Rule Engine' - tagline: Sub-microsecond latency, 500K+ QPS, with visual editor + text: 'Open-Source Decision Platform' + tagline: Author, test, and govern business rules — with Studio, platform governance, and a fast engine under the hood. image: src: /logo.png alt: Ordo @@ -20,24 +20,24 @@ hero: link: https://github.com/Pama-Lee/Ordo features: - - icon: ⚡ - title: Blazing Fast - details: 1.63µs average execution time (50-80ns with JIT). 600x faster than 1ms target. Zero-allocation hot path. + - icon: 🏛️ + title: Decision Platform + details: Org & project management, fact catalog, typed decision contracts, and full version history. Own your decision logic — don't scatter it across codebases and spreadsheets. - icon: 🎨 - title: Visual Editor - details: Design complex rules with drag-and-drop flow editor. Real-time execution with WASM. Import/export .ordo files. - - icon: 🔧 - title: Flexible Rules - details: Step flow model, rich expressions, built-in functions, and field coalescing. Compiled binary format for rule protection. + title: Studio + details: Drag-and-drop flow editor, decision tables, one-click template instantiation, and test case management. Author rules without friction. + - icon: 🧪 + title: Test Management + details: Create, run, and export test suites per ruleset. CI-compatible YAML. Know your rules work before they ship. + - icon: ⚡ + title: Fast Engine + details: Sub-microsecond execution with Cranelift JIT. Runs as HTTP · gRPC · WASM · CLI or embedded in any Rust application. - icon: 🛡️ - title: Production Ready - details: Deterministic execution, full tracing, hot reload, Ed25519 rule signing, audit logging, and multi-tenancy support. + title: Governance + details: Typed input/output contracts, audit logging, Ed25519 rule signing, and rollback. Traceable and compliant by default. - icon: 🔌 - title: Easy Integration - details: HTTP REST API, gRPC support, WebAssembly for browser, and npm packages (@ordo/editor-vue, @ordo/editor-core). - - icon: 📊 - title: Observable - details: Prometheus metrics, health checks, structured audit logs, and rule versioning with rollback. + title: Runs Everywhere + details: Single binary server, browser via WebAssembly, embedded in Rust apps. One engine across every deployment target. --- ## Quick Example @@ -71,12 +71,3 @@ features: } ``` -## Performance - -| Metric | Result | -| ----------------------------------- | ---------------- | -| Single rule execution (interpreter) | **1.63 µs** | -| Single rule execution (JIT) | **50-80 ns** | -| Expression evaluation | **79-211 ns** | -| HTTP API throughput | **54,000 QPS** | -| Projected multi-thread | **500,000+ QPS** | diff --git a/ordo-editor/apps/docs/zh/guide/what-is-ordo.md b/ordo-editor/apps/docs/zh/guide/what-is-ordo.md index 8a4f0fc4..8a4cbc74 100644 --- a/ordo-editor/apps/docs/zh/guide/what-is-ordo.md +++ b/ordo-editor/apps/docs/zh/guide/what-is-ordo.md @@ -1,86 +1,56 @@ # Ordo 是什么? -**Ordo**(拉丁语意为“秩序”)是一款专为极致性能和可靠性设计的企业级规则引擎。它完全由 Rust 构建,能够以**亚微秒级延迟**评估业务规则,并支持**每秒 500,000+ 次执行**。 +**Ordo**(拉丁语意为"秩序")是一个开源决策平台,面向需要**真正拥有自身决策逻辑**的团队——而不是让这些逻辑散落在代码库、电子表格和只有老员工才知道的地方。 -## 核心特性 +它包含三个层次: -### 可视化规则编辑器 +- **引擎(Engine)** — 亚微秒级规则执行,Cranelift JIT 编译,支持 HTTP · gRPC · WASM · CLI。 +- **平台(Platform)** — 组织与项目管理、事实目录、决策契约、版本历史、规则模板。 +- **Studio** — 可视化流程编辑器、测试用例管理、一键实例化模板。 -使用直观的拖放式流程编辑器设计复杂的业务规则: +## 为什么需要决策平台? -- **流程视图**:将规则逻辑可视化为连接的决策树 -- **表单视图**:使用结构化表单界面编辑条件和动作 -- **实时执行**:利用 WASM 驱动的执行功能即时测试规则 -- **执行追踪**:通过可视化路径高亮进行分步调试 +大多数团队从规则引擎开始,然后发现难点不在执行速度——而在于:哪些规则存在、谁修改了它们、它们是否仍然正确,以及如何交接给新成员。 -### 极速性能 +Ordo 覆盖规则的完整生命周期: -- **1.63 µs** 平均规则执行时间 -- 比 1ms 的目标**快 600 倍** -- 零分配热路径 -- 预编译表达式评估 - -### 灵活的规则定义 - -- **步骤流模型**:带有条件跳转的线性决策步骤 -- **丰富的表达式**:比较、逻辑运算符、函数、条件语句 -- **内置函数**:`len()`、`sum()`、`avg()`、`upper()`、`lower()`、`abs()`、`min()`、`max()` -- **字段合并**:用于处理缺失字段的 `coalesce(field, fallback, default)` - -### 生产就绪 - -- **确定性执行**:相同的输入 → 相同的路径 → 相同的结果 -- **执行追踪**:全面了解调试的每一个步骤 -- **热重载**:无需重启服务即可更新规则 -- **审计日志**:追踪所有规则变更和执行 - -### 易于集成 - -- **HTTP REST API**:简单的基于 JSON 的接口 -- **WebAssembly**:直接在浏览器中运行规则 -- **gRPC 支持**:高性能二进制协议 +| 阶段 | Ordo 提供的能力 | +|------|----------------| +| **编写** | Studio 流程编辑器、决策表、模板库 | +| **测试** | 规则集级别测试用例、CI 集成、导出 YAML | +| **治理** | 事实目录、带类型的契约、版本历史、审计日志 | +| **执行** | 高性能引擎、热重载、多租户 | +| **观测** | 执行追踪、Prometheus 指标、结构化日志 | ## 架构 -Ordo 由几个组件组成: - ``` ┌─────────────────────────────────────────────────────────────┐ -│ 可视化编辑器 (Vue 3) │ -│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │ -│ │ 流程视图 │ │ 表单视图 │ │ 执行追踪 │ │ -│ └─────────────┘ └─────────────┘ └─────────────────────┘ │ -└─────────────────────────────────────────────────────────────┘ - │ - ▼ -┌─────────────────────────────────────────────────────────────┐ -│ ordo-wasm (WASM) │ -│ 浏览器端规则执行 │ -└─────────────────────────────────────────────────────────────┘ - -┌─────────────────────────────────────────────────────────────┐ -│ ordo-server (Rust) │ -│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌───────────────┐ │ -│ │ HTTP │ │ gRPC │ │ UDS │ │ 规则存储 │ │ -│ └─────────┘ └─────────┘ └─────────┘ └───────────────┘ │ -└─────────────────────────────────────────────────────────────┘ - │ - ▼ -┌─────────────────────────────────────────────────────────────┐ -│ ordo-core (Rust) │ -│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │ -│ │ 执行器 │ │ 评估器 │ │ 表达式解析器 │ │ -│ └─────────────┘ └─────────────┘ └─────────────────────┘ │ +│ 平台层 (ordo-platform) │ +│ 组织 · 项目 · 事实目录 · 决策契约 · 模板 · 测试用例 │ +└──────────────────────────┬──────────────────────────────────┘ + │ +┌──────────────────────────▼──────────────────────────────────┐ +│ Studio (apps/studio) │ +│ 流程编辑器 · 测试运行器 · 模板库 │ +└──────────────────────────┬──────────────────────────────────┘ + │ +┌──────────────────────────▼──────────────────────────────────┐ +│ 引擎层 (ordo-server) │ +│ HTTP REST · gRPC · Unix Socket · Prometheus 指标 │ +└──────────────────────────┬──────────────────────────────────┘ + │ +┌──────────────────────────▼──────────────────────────────────┐ +│ ordo-core(Rust) │ +│ 解释器 · 字节码 VM · Cranelift JIT · WASM │ └─────────────────────────────────────────────────────────────┘ ``` -## 用例 +## 使用场景 -Ordo 非常适合: +只要业务逻辑需要**可见、可测试、可变更**而不触发完整部署,Ordo 就适用: -- **风险评估**:信用评分、欺诈检测、KYC 检查 -- **定价规则**:动态定价、折扣计算、促销活动 -- **资格检查**:贷款审批、保险承保 -- **路由逻辑**:订单路由、负载均衡决策 -- **合规规则**:监管检查、政策执行 -- **功能开关**:A/B 测试、渐进式发布 +- **风控与合规** — 信用评分、反欺诈、KYC 校验、监管政策执行 +- **定价与促销** — 动态定价、折扣规则、活动资格判断 +- **路由与分配** — 订单路由、支付通道选择、流量决策 +- **准入与资格** — 贷款审批、功能开关、会员等级逻辑 diff --git a/ordo-editor/apps/docs/zh/index.md b/ordo-editor/apps/docs/zh/index.md index bfe89969..d853ba53 100644 --- a/ordo-editor/apps/docs/zh/index.md +++ b/ordo-editor/apps/docs/zh/index.md @@ -3,8 +3,8 @@ layout: home hero: name: 'Ordo' - text: '高性能规则引擎' - tagline: 亚微秒级延迟,50万+ QPS,配备可视化编辑器 + text: '开源决策平台' + tagline: 编写、测试、治理业务规则 — Studio 可视化编辑、平台级治理,底层引擎快到感觉不到。 image: src: /logo.png alt: Ordo @@ -20,24 +20,24 @@ hero: link: https://github.com/Pama-Lee/Ordo features: - - icon: ⚡ - title: 极速性能 - details: 1.63µs 平均执行时间(JIT 编译后 50-80ns)。比 1ms 目标快 600 倍。零分配热路径。 + - icon: 🏛️ + title: 决策平台 + details: 组织与项目管理、事实目录、带类型的决策契约,以及完整的版本历史。让团队真正拥有自己的决策逻辑,而不是散落在代码库和电子表格里。 - icon: 🎨 - title: 可视化编辑器 - details: 使用拖放流程编辑器设计复杂规则。通过 WASM 实时执行。支持 .ordo 文件导入/导出。 - - icon: 🔧 - title: 灵活规则 - details: 步骤流模型,丰富的表达式,内置函数和字段合并。编译二进制格式保护规则逻辑。 + title: Studio + details: 拖拽式流程编辑器、决策表、一键实例化模板,以及测试用例管理。低摩擦地编写规则。 + - icon: 🧪 + title: 测试管理 + details: 为每个规则集创建、运行、导出测试套件。兼容 ordo-cli 的 YAML 格式,直接接入 CI/CD。上线前确保规则正确。 + - icon: ⚡ + title: 高性能引擎 + details: 亚微秒级执行,Cranelift JIT 编译。支持 HTTP · gRPC · WASM · CLI,或嵌入任意 Rust 应用。 - icon: 🛡️ - title: 生产就绪 - details: 确定性执行,完整追踪,热重载,Ed25519 规则签名,审计日志和多租户支持。 + title: 治理 + details: 带类型的输入/输出契约、审计日志、Ed25519 规则签名与一键回滚。默认可追溯、合规。 - icon: 🔌 - title: 易于集成 - details: HTTP REST API,gRPC 支持,浏览器 WebAssembly,以及 npm 包(@ordo/editor-vue, @ordo/editor-core)。 - - icon: 📊 - title: 可观测性 - details: Prometheus 指标,健康检查,结构化审计日志,以及规则版本管理与回滚。 + title: 随处运行 + details: 单二进制服务器、浏览器端 WebAssembly、嵌入式 Rust 集成。同一个引擎覆盖所有部署场景。 --- ## 快速示例 @@ -71,12 +71,3 @@ features: } ``` -## 性能 - -| 指标 | 结果 | -| -------------------- | ---------------- | -| 单规则执行(解释器) | **1.63 µs** | -| 单规则执行(JIT) | **50-80 ns** | -| 表达式评估 | **79-211 ns** | -| HTTP API 吞吐量 | **54,000 QPS** | -| 预计多线程 | **500,000+ QPS** |