仓库角色:本仓库是 GitHub 镜像。权威源(primary repo)在 Gitee:https://gitee.com/evorule/evorule-console-cloud。 Issue / PR 请提交到 Gitee,GitHub 侧仅供镜像与推广展示。
evorule rule-engine console · the connected public edition — a professional starting point for secondary developers (core engine + connectivity + cloud LLM + platform governance)
Language / 语言: English · 中文 / Chinese
👉 Launch the WASM Online Demo →
No download, no install, no server — the evorule engine itself is compiled to WebAssembly and runs inside your browser. Open the URL and start in seconds; after the first visit the app is cached by a Service Worker and keeps working offline.
- GitHub Pages (primary): https://evorule.github.io/evorule-console-cloud/
What you get online: the full evorule engine in-browser (pure-synchronous execute_transition + BLAKE3 hash chain verified client-side), all 16 business rules live (finance 6 + medical 6 + MLPS 4), an interactive 7-step guided tour, audit-chain verification, and time-travel replay — all with zero network dependency after first load.
| Online (WASM) | Local (Experience Pack / dev) | |
|---|---|---|
| Engine | evorule compiled to WASM, runs in your browser | Real Rust evorule-server |
| Setup | Open the URL — that's it | Download pack → double-click start.bat (or npm run dev) |
| Business rules | 16 rules live (finance 6 + medical 6 + MLPS 4) | Same 16 rules, editable |
| Guided walkthrough | 7-step interactive tour | 7-step tutorial (QUICKSTART.md) |
| Audit chain | BLAKE3 hash-chain, verified in-browser | BLAKE3 hash-chain + WAL persistence |
| Offline use | ✅ Service Worker cache (after first visit) | ✅ Fully offline |
| Rule hot-reload | ❌ rules are read-only in-browser | ✅ edit JSON + /api/rules/reload |
| Bundle management | ❌ not available online | ✅ import / activate bundles |
| Persistence | ❌ session resets on refresh | ✅ WAL persistence |
Just want a quick feel? Stay online. Want to edit rules, hot-reload, manage Bundles, or keep state across refreshes? Grab the local experience pack. Append
?backend=wasm|http|mockto the URL to force a backend mode (the online build defaults towasm).
- ⚡ Online WASM demo (no install) — open the URL, walk the 7-step tour, verify the BLAKE3 chain in-browser
- 5-Minute Quick Start (Developer Path) — clone the repo + dev environment, go from 0 to your first running rule
- ❓ In-browser Help Page — the "❓ Help" button at the bottom of the sidebar after the service starts
- One-Click Start/Stop Guide — both desktop double-click and command-line methods
evorule is the compliance & audit layer for AI Agents — making every decision of an AI Agent auditable, replayable, and rollable-back.
| Pain Point | evorule's Answer |
|---|---|
| AI Agent decisions are opaque | BLAKE3 hash-chain — every decision is tamper-evident and traceable |
| Can't locate root cause when something breaks | Time-travel replay + causal-chain analysis, locate in seconds |
| Compliance audits are hard to pass | Audit export satisfies EU AI Act Article 12 + China MLPS 2.0 Level 3 |
| Rule publishing has no controls | Three-tier permission approval + rolling session hot-reload with zero downtime |
| Repo | Role |
|---|---|
| evorule | Core engine (TCB / Reactor / Governance, on crates.io) |
| evorule-server | HTTP server (auth / audit / plugins / template marketplace) |
| This repo | The single project owner entry point (browser console, professional starting point for secondary developers) |
| Online WASM demo | No registration, no backend — the real evorule engine compiled to WASM runs in-browser; 16 business rules + 7-step tour, Service Worker offline cache |
- Add a rule (2 min): add a hospital rule "patients over 65 with fever must get a CT first"
- Find a problem (1 min): locate why patient P-1283 triggered an anomaly alert
- Edit a rule (3 min): change the fever threshold from 38°C to 37.5°C
- Compliance gate (2 min): an AI Agent calls a transfer without MFA → gate blocks it + BLAKE3 leaves a trail
- Contract Payment Guard — blocks when payment prerequisites are missing
- Expense Compliance Check — rejects duplicate invoices; escalates over-limit to approval chain
- Equipment Inspection Alert — threshold-linked alerting and escalation
- AI Compliance Gate — AI Agent initiates a transfer without MFA → blocked and logged
Each rule ships with two sets of contrast inputs and field-by-field expected outputs — reproduce one in 3 minutes. See Scenario Examples Overview.
- BLAKE3 tamper-evident audit chain: every Fact is hash-linked; any tampering is detected
- Time-travel replay: rewind to any version, diff comparison + causal-chain tracing
- MLPS 2.0 Level-3 gate: compliance check before AI Agent tool calls (§8.1.4.1.d MFA / §8.1.4.7.b encryption)
- Compliance report export: 6 content types × 4 formats (JSON/CSV/XML/PDF); PDF prefers server-side rendering (
POST /api/export/pdf), auto-degrades to browser print when the server doesn't support it - Rolling session hot-reload: rule-set publishing with zero downtime, monotonic version increments
- Platform auth & multi-user governance: login / profile / user management / role-permission matrix /
can()permission judgment moved server-side - Governance Center: connects directly to the evorule-rule asset library (:18081), entry 5-state lifecycle (Draft→Candidate→Active→Published→Rejected) + version chain + online knowledge-entry editing
- Template marketplace: template upload / online edit / download
- Collaborative approval workflow: three-tier permissions (admin/lead/auditor), rule publishing requires approval
- WASM in-browser engine (v0.5.0):
WasmBackendruns the real evorule engine as WebAssembly — pure-synchronousexecute_transition, zero backend, all 16 demo rules live; feature flag?backend=wasm|http|mock - Offline-capable demo: Service Worker caches the app shell + WASM module; first visit once, then use offline; GitHub + Gitee dual Pages deployment
evorule-console-cloud is the single project owner entry point of the entire evorule ecosystem: every project owner operation on evorule from the browser — rule library, execution, audit, replay, approval — converges in this console. At the same time it is also a professional starting-point tool for secondary developers: developers build their own products on top of this repo (different products, same starting point).
| Layer | Repo | Positioning | LLM | Network | Kernel relation |
|---|---|---|---|---|---|
| evorule-console (kernel) | standalone | rule-engine console kernel — execution only, no intelligence | ❌ none | ❌ none (local HTTP only) | 0 (consumes evorule core) |
| evorule-console-cloud (this repo) | standalone | professional starting point for secondary developers | cloud LLM | ✅ connected | kernel snapshot inlined (src/lib/kernel/), no npm dependency |
| Advanced edition | standalone | confidential-industry customization | local GPU LLM | ✅ connected / Tauri | kernel snapshot inlined |
This repo and the kernel repo each have independent semver. The kernel is inlined as a source snapshot in src/lib/kernel/; this repo evolves independently; the kernel repo remains the upstream reference, and subsequent snapshot syncs are done manually on demand.
- WASM in-browser engine:
WasmBackendruns the real evorule engine as WebAssembly — open the online URL and the rule engine executes entirely in your browser, zero backend / zero download / zero install; pure-synchronousexecute_transition+ BLAKE3 audit chain verified client-side - 16 business rules live online: finance 6 + medical 6 + MLPS 4 all executable in-browser; interactive 7-step guided tour
- Offline demo + dual Pages: Service Worker caches app shell + WASM module (offline after first visit); GitHub Pages + Gitee Pages (China mirror; platform discontinued 2026-09-15) deployment; SPA fallback
- Backend feature flag:
?backend=wasm|http|mockto force a mode (online build defaults towasm) - Full details in CHANGELOG
- First-use project owner experience fixes: user-friendly rule-validation messages; plain-language onboarding/wizard/workbench wording; "local draft vs published" semantics clarified; rule-library developer-mode JSON editor; executor default command business-ized; JSON-tree expand/collapse hint; audit/export empty-state guidance; governance password placeholder and five-state lifecycle completion;
--insecure-servein start-all.ps1 - App credential & quota management: platform
/appsentry for issuing/listing/revoking app API keys, per-app rate-limit and daily quota with usage column - Plugin approval workbench: centralized plugin runtime health (online/offline badges) + grouped pending config-approval proposals, approval enforced server-side
- Unauthenticated-access redirect fix: when accessing marketplace / runtime / workspace / export / import-export / view pages without logging in, project owners are now uniformly redirected to the login page (previously silently bounced to the home page, easily mistaken for "page broken"); page reachability after login is unchanged
- Test workbench: rule dry-run + structured deployment-evidence stream (verify rule behavior before deployment)
- Knowledge data plane:
/knowledgeroute + governance-center online knowledge-entry editing (Draft edit/delete + new version chain) - Permission management UI: permission-entry lifecycle + judgment test bench
- Template marketplace server wiring: project owner templates use the server as single source of truth + template online-edit UI
- PDF server-side render wiring: Bearer-auth passthrough + explicit on-screen degradation reason
- 15 governance/execution API wirings: audit import / session derivation / reap / payload injection / shared facts, executor stop / interrupt, rule pre-check, sandbox report, deployment provenance, execution-domain rules, queue detail, session list, member add/remove, service list, etc.
- Platform-user integration: platform users connected to workspace members (idempotent auto-join + explicit 403 retry)
- "Deploy to execution domain": governance dataset → execution-domain publishing-chain export UI
- Regulation-anchor edit channel: in-product fix path for publishing-gate issues
- Category-label management: drawer-style management + Escape keyboard close channel
- Scenario example rules v2: business-instruction paradigm + in-repo rules pre-seeded (4 rules, 9 cases, all passing)
- Rule-edit form deepening + validator aligned to authoritative schema; journey usability cleanup + new project owner experience fixes
- Full details in CHANGELOG
- Rule-library view usable offline (built-in demo dataset + 4 guided tasks)
- Executor / state / audit / time-travel: connect to evorule-server to run (local / remote addresses supported)
- Platform-login integration (server unified auth) + profile + server-side permission judgment; user-management / role-management pages (permission-matrix editor)
- Overview Dashboard (widget-registry-based); navigation registry-based (sidebar / jump-card / command-palette share one manifest and one gate)
- Historical-session audit-archive panel + platform-auth event panel
- Cloud LLM assist, three uses: create rule drafts / explain rules / generate test inputs (9 vendor presets)
- Online-mode switch (offline ↔ online), view selection, network & LLM config persistence
- apiKey security: stored only in browser localStorage, never in URL / logs / error messages
| Goal | Version | Notes |
|---|---|---|
| Local LLM (L2) | later | paid extension, local GPU LLM |
| Ongoing optimization | continuous | refine UI / features / docs per community feedback |
Version semantics:
0.xis the pre-release series;v1.0.0corresponds to feature-complete. Feedback and defects are welcome via Issues.
This repo does not depend on the kernel via npm. The kernel's (evorule-console v0.2.0) actual dependency closure is inlined as a source snapshot in src/lib/kernel/:
- Entry:
src/lib/kernel/index.ts(export surface aligned with the kernel package, omitting unused modules) - Contents: backend abstractions & types, rules/session/audit/view stores, AssistantProvider extension slot, RuleValidator, executor/state/audit/time-travel views & ttd components
- Boundary: after the snapshot, it evolves together with this repo; subsequent kernel-repo changes are not auto-synced and require manual reconciliation
git clone https://gitee.com/evorule/evorule-console-cloud.git
cd evorule-console-cloud
npm install
npm run dev # developer mode: http://localhost:5174 (for daily use prefer the one-click starter, see below)The rule-library view needs no backend and can be tried offline; the executor/state/audit/time-travel views need evorule-server running on
localhost:18080(online mode can be configured for a remote address).
.github/workflows/deploy-demo.yml automatically builds and deploys to GitHub Pages on every push to the main branch.
First-time enable steps (GitHub):
- Go to the GitHub repo → Settings → Pages
- Set Source to GitHub Actions (not "Deploy from a branch")
- Push a commit to
main(or manually triggerworkflow_dispatch) to trigger the first build - Once deployed, the URL looks like
https://<owner>.github.io/evorule-console-cloud/
Features: adapter-static full pre-render + WasmBackend (real evorule engine as WebAssembly), zero network dependency after first load, Service Worker offline cache, all 16 business rules live + 7-step guided tour. The online build defaults to ?backend=wasm; append ?backend=http|mock to switch modes.
To fully run the executor/state/audit views you need evorule-server running. Mind the CORS config (a key pitfall, pick one of two):
- Option A (direct connect +
--allowed-origins): evorule-server explicitly allows the public-edition dev/preview origins at startup (see startup order below). For online mode or production deployment. - Option C (vite proxy, zero config): leave
localBaseUrlin net-config empty (same-origin); vite dev/preview auto-proxies/apito127.0.0.1:18080(seeserver.proxyinvite.config.ts). Dev/preview only, no server config needed.
-
Start evorule-server (with CORS allowing public-edition dev/preview origins) — in the evorule-server repo directory (release binary already built):
target\release\evorule-server.exe --addr 127.0.0.1:18080 \ --allowed-origins "http://localhost:5174,http://localhost:4173,http://127.0.0.1:5174,http://127.0.0.1:4173"
-
Start the public-edition dev server — in this repo directory:
npm run dev # http://localhost:5174 -
Create an initial session (so the executor UI shows the submit area):
curl -X POST http://127.0.0.1:18080/api/sessions # → {"message":"Session created","session_id":1} -
Open in browser:
http://localhost:5174/
npm run build
npm run preview -- --host 127.0.0.1 --port 4173| Pitfall | Symptom | Fix |
|---|---|---|
| CORS cross-origin | evorule-server defaults to strict same-origin, cross-port rejected | Option A: add --allowed-origins at startup; Option C: leave localBaseUrl empty (same-origin), vite proxy auto-proxies /api → 127.0.0.1:18080 (dev/preview only) |
| Host alignment | localhost and 127.0.0.1 are different origins |
public-edition net-config defaults to localhost:18080 (aligned with vite dev); when preview uses --host 127.0.0.1, update net-config accordingly |
| Port in use | after e2e tests, npm run dev reports Port 5174 is in use or browser shows "This site can't be reached" |
npm run clean && npm run dev (kill zombie processes) |
| Empty sessions | after evorule-server starts, sessions are empty, executor UI shows no submit area | manually POST /api/sessions to create the initial session |
The public-edition LLM apiKey goes only to the browser localStorage (evorule-console-cloud:llm-config), never read from .env. Fill it in Settings panel → LLM config tab.
Nine built-in vendor presets: Zhipu GLM (recommended, has free quota) / Tongyi Qianwen / DeepSeek / MiniMax / Kimi / OpenAI / Ollama (local) / ERNIE / Custom (any OpenAI-compatible endpoint). Recommended starting point: get an apiKey from Zhipu Open Platform.
Preferred path — platform login: if the server has the platform-user system enabled (admin created on first-run bootstrap), just log in on the login page — no manual token entry needed. When the server enables --demo-auth, a demo entry is provided (server controls visibility via a switch; retained when server is unreachable).
For the static-token direct-connect scenario: in Settings panel → Network config → Auth Token, enter the token matching the server (auto-saved on blur; empty = no credentials sent, usable only with an unauthenticated server). The whole chain (executor session API, workspace rule library, publish-approval/rollback, production state/version history) uniformly carries the Authorization: Bearer header.
Two server-side token env vars (see evorule-server README "Environment Variables / CLI Args" for details):
| Env var | Semantics |
|---|---|
EVORULE_AUTH_TOKEN |
ordinary Bearer token (browser-user identity); must be configured for production — when unset, auth is fully off and protected-domain write admission fails (dev bypass semantics) |
EVORULE_SERVICE_TOKEN |
service-identity token (for inter-service calls, e.g. evo-agent sidecar); protected domains stable.llm.* / stable.system.* writable only by this identity, should not be used on the browser side |
Notes:
- The token is saved in the local browser localStorage (same trust level as the LLM apiKey); don't enter it on a shared device; for higher assurance, deploy the public edition behind a reverse proxy same-origin with the server and restrict access
- The connection test (Settings panel "Test Connection") carries the currently entered token, so you can directly verify credential validity
- when the server enables auth but this side hasn't entered a token, the API returns 401 — first check whether the two tokens match
Full testing instructions (environment setup → 4 kinds of automated tests → evorule-server co-debug → LLM co-debug → troubleshooting) are in CONTRIBUTING.md §Testing Requirements.
Run the full test suite quickly (must be all-green before a PR):
npm run check && npx vitest run && npm run test && npm run build| Test | Command | Measured result (2026-09-06) |
|---|---|---|
| Type check | npm run check |
0 errors / 0 warnings |
| Unit tests | npx vitest run |
1214/1214 (60 test files) |
| e2e tests | npm run test |
5 suites: navigation / settings-flow / assistant-flow / page-smoke / step-button regression |
| Production build | npm run build |
✅ build/ |
e2e needs a browser installed on first run:
npx playwright install chromiumWhy e2e usesworkers: 1? See CONTRIBUTING.md §e2e testing
npm run verify # vitest: verify $lib/kernel snapshot import path (CONSOLE_VERSION=0.2.0 + all exports available)
npm run check # svelte-check: 0 errors / 0 warnings
npm run test:unit # vitest: unit tests (assistant + backend + types + stores + governance …)
npm run test # playwright: e2e (navigation + settings-flow + assistant-flow + page-smoke + regression)
npm run build # adapter-static: output static files to build/- SvelteKit 5 + Svelte 5 (runes mode) — aligned with the kernel
- TypeScript (strict)
- Vite + adapter-static
- vitest (unit tests + import verification) + playwright (e2e)
- kernel snapshot
src/lib/kernel/(taken from evorule-console v0.2.0)
evorule-console-cloud/
├── src/
│ ├── routes/ # 17 routes (workbench / governance / audit / knowledge /
│ │ # marketplace / users / roles / permissions / monitor /
│ │ # publish-queue / version-history / export / login / help …)
│ ├── lib/
│ │ ├── backend/ # CloudHttpBackend (connected / offline dual mode)
│ │ ├── assistant/ # CloudLlmAssistant + llm-fetch + prompts + types
│ │ ├── config/ # net-config + llm-config + llm-presets (9 presets) + governance-config + nav-registry
│ │ ├── data/ # demo datasets + templates + guided tasks
│ │ ├── governance/ # governance backend + store (publish / approve / audit, connects to evorule-rule :18081)
│ │ ├── stores/ # cross-view shared state (session / dataset / export / rule-library / settings …)
│ │ ├── kernel/ # kernel source snapshot (from evorule-console v0.2.0)
│ │ └── views/ # 25 view components
│ ├── app.css # design tokens (aligned with kernel, dark theme)
│ └── verify.test.ts # import verification (vitest)
├── tests/ # playwright e2e (5 suites)
├── docs/ # public docs (Diátaxis 4 types + ADR + scenario examples)
├── package.json # dependency declaration (kernel inlined, no npm kernel dependency)
├── svelte.config.js # adapter-static
├── vite.config.ts # port 5174
└── README.md (this file)
AGPL-3.0-or-later + commercial dual-license — see LICENSE / DUAL_LICENSE.md.
Commercial license inquiries: evorulelab@gmail.com
| File | Description |
|---|---|
| NOTICE.md | Notice (relationship with the evorule-console kernel) |
| CHANGELOG.md | Change log |
| CONTRIBUTING.md | Contribution guide (core principles + prohibited items) |
| SECURITY.md | Security policy (incl. LLM apiKey security design) |
| RELEASE_PROCESS.md | Release process |
| AUTHORS.md | Authors |
| CODE_OF_CONDUCT.md | Contributor covenant |
| TRADEMARK.md | Trademark policy |
| CLA-individual.md | Individual Contributor License Agreement |
| COMMERCIAL_LICENSE.md | Commercial license |
| FREE_COMMERCIAL_LICENSE.md | Free commercial-exemption eligibility |
See CONTRIBUTING.md.
Copyright (C) 2026 EvoRule Project. All rights reserved.
evorule-console-cloud 基于 evorule-console 内核快照(src/lib/kernel/,取自内核 v0.2.0)扩展:
- 联网:可连接远程 evorule-server(非仅本地 loopback)
- 平台治理:登录 / 用户 / 角色 / 权限矩阵 / 发布审批,对接 evorule-server 统一认证与 evorule-rule 资产库
- 云 LLM 辅助:OpenAI 兼容协议,9 家厂商预设(智谱/通义/DeepSeek/MiniMax/Kimi/OpenAI/Ollama/ERNIE/自定义),辅助生成规则草案/解释规则/生成测试输入
- 项目方审核确认:LLM 只生成草案,最终规则是项目方审核的 JSON,不破坏 evorule「确定性执行」基调
- 本地 LLM(L2):规划中,付费扩展
LLM 是辅助层,不参与确定性执行 — 执行链路完全不经过 LLM,规则即数据,项目方审核才生效。
无需下载、无需安装、无需起服务——evorule 引擎本身被编译成 WebAssembly,直接在你的浏览器里运行。打开链接几秒即用;首次访问后 App 被 Service Worker 缓存,之后可离线使用。
- GitHub Pages(主):https://evorule.github.io/evorule-console-cloud/
在线能体验到什么:浏览器内跑真实 evorule 引擎(纯同步 execute_transition + 客户端验证 BLAKE3 哈希链),16 条业务规则全部在线(财务 6 + 医疗 6 + 等保 4),交互式 7 步引导教学,审计链验证与时间旅行回放——首访之后零网络依赖。
| 在线(WASM) | 本地(体验包 / 开发) | |
|---|---|---|
| 引擎 | evorule 编译为 WASM,在浏览器内运行 | 真实 Rust evorule-server |
| 启动 | 打开链接即可 | 下载体验包 → 双击 start.bat(或 npm run dev) |
| 业务规则 | 16 条在线可跑(财务 6 + 医疗 6 + 等保 4) | 同样 16 条,可编辑 |
| 引导教学 | 7 步交互式引导 | 7 步教程(QUICKSTART.md) |
| 审计链 | BLAKE3 哈希链,浏览器内验证 | BLAKE3 哈希链 + WAL 持久化 |
| 离线使用 | ✅ Service Worker 缓存(首访后) | ✅ 完全离线 |
| 规则热重载 | ❌ 在线规则只读 | ✅ 改 JSON + /api/rules/reload |
| Bundle 管理 | ❌ 在线不可用 | ✅ 导入 / 激活 bundle |
| 持久化 | ❌ 刷新后会话重置 | ✅ WAL 持久化 |
只是想快速感受?留在在线版即可。想编辑规则、热重载、管理 Bundle 或跨刷新保留状态?请下载 本地体验包。在 URL 后追加
?backend=wasm|http|mock可强制切换后端模式(在线构建默认wasm)。
- ⚡ 在线 WASM Demo(免安装) — 打开链接,走完 7 步引导,在浏览器里验证 BLAKE3 审计链
- 5 分钟上手(开发者路径) — 克隆仓 + dev 环境,从 0 到跑通第一条规则
- ❓ 浏览器内帮助页 — 启服务后侧栏底部"❓ 帮助"按钮
- 一键启停指南 — 桌面双击 / 命令行两种方式
evorule 是 AI Agent 的「合规审计层」— 让 AI Agent 的每个决策可审计、可回放、可回滚。
| 痛点 | evorule 解法 |
|---|---|
| AI Agent 决策不透明 | BLAKE3 哈希链,每个决策不可篡改可追溯 |
| 出问题无法定位根因 | 时间旅行回放 + 因果链分析,秒级定位 |
| 合规审计难通过 | 审计导出满足 EU AI Act Article 12 + 等保 2.0 三级 |
| 规则发布无管控 | 三级权限审批 + 滚动 session 热更新零停机 |
| 仓 | 角色 |
|---|---|
| evorule | 核心引擎(TCB / 反应器 / 治理,crates.io) |
| evorule-server | HTTP 服务端(认证 / 审计 / 插件 / 模板市场) |
| 本仓 | 唯一项目方入口(浏览器面板,二次开发者专业起点) |
| 在线 WASM Demo | 无需注册、无需后端——真实 evorule 引擎编译为 WASM 在浏览器内运行;16 条业务规则 + 7 步引导,Service Worker 离线缓存 |
- 加规则(2 分钟):给医院加一条「65 岁以上发烧必须先 CT」规则
- 查问题(1 分钟):定位病人 P-1283 为何触发异常告警
- 改规则(3 分钟):把发烧阈值从 38°C 改为 37.5°C
- 合规门禁(2 分钟):AI Agent 调用转账但未 MFA → 门禁阻断 + BLAKE3 留痕
- 合同条款校验 — 付款前提缺失即阻断
- 报销合规检查 — 重复发票驳回;超标升级审批链
- 设备巡检告警 — 阈值联动告警与升级上报
- AI 合规门禁 — AI Agent 未过 MFA 发起转账 → 阻断留痕
每条规则附两组对照输入与逐字段预期输出,3 分钟可复现一条。见 场景示例总览。
- BLAKE3 不可篡改审计链:每个 Fact 哈希链接,篡改即被发现
- 时间旅行回放:回溯任意版本,diff 对比 + 因果链追溯
- 等保 2.0 三级门禁:AI Agent 工具调用前合规检查(§8.1.4.1.d MFA / §8.1.4.7.b 加密)
- 合规报告导出:6 种内容 × 4 种格式(JSON/CSV/XML/PDF);PDF 优先服务端渲染(
POST /api/export/pdf),server 不支持时自动降级浏览器打印 - 滚动 session 热更新:规则集发布零停机,版本单调递增
- 平台认证与多用户治理:登录 / 个人中心 / 用户管理 / 角色权限矩阵 / 应用凭据管理 /
can()权限判定后端化 - 治理中心:直连 evorule-rule 资产库(:18081),条目 5 态生命周期(Draft→Candidate→Active→Published→Rejected)+ 版本链 + 知识条目在线编辑
- 模板市场:模板上传 / 在线编辑 / 下载
- 协作审批工作流:三级权限(admin/lead/auditor),规则发布需审批
- WASM 浏览器内引擎(v0.5.0):
WasmBackend把真实 evorule 引擎编译为 WebAssembly 运行——打开在线链接即在浏览器内执行规则,零后端 / 零下载 / 零安装;纯同步execute_transition+ BLAKE3 审计链客户端验证;feature flag?backend=wasm|http|mock - 离线可用 Demo:Service Worker 缓存 App 外壳 + WASM 模块(首访后可离线);GitHub Pages + Gitee Pages(国内镜像,该平台 2026-09-15 停服下线)双平台部署
evorule-console-cloud 是 evorule 全生态的唯一项目方入口:浏览器端项目方对 evorule 的一切操作——规则库、执行、审计、回放、审批——都收敛于此面板。同时它也是面向二次开发者的专业起点工具:开发者基于本仓构建自己的产品(功能各不相同,但起点一致)。
| 层级 | 仓 | 定位 | LLM | 网络 | 内核关系 |
|---|---|---|---|---|---|
| evorule-console(内核) | 独立 | 规则引擎面板内核,无智能只有执行 | ❌ 无 | ❌ 无(仅本地 HTTP) | 0(消费 evorule 核心) |
| evorule-console-cloud(本仓) | 独立 | 二次开发者专业起点 | 云 LLM | ✅ 联网 | 内核快照内联(src/lib/kernel/),无 npm 依赖 |
| 高级版 | 独立 | 保密行业定制 | 本地 GPU LLM | ✅ 联网/Tauri | 内核快照内联 |
本仓与内核仓各自独立 semver。内核以源码快照形式内联于 src/lib/kernel/,本仓可独立演进;内核仓仍是上游参考,快照的后续同步按需手动进行。
- WASM 浏览器内引擎:
WasmBackend把真实 evorule 引擎编译为 WebAssembly——打开在线链接即纯浏览器内执行规则,零后端 / 零下载 / 零安装;纯同步execute_transition+ BLAKE3 审计链客户端验证 - 16 条业务规则全在线:财务 6 + 医疗 6 + 等保 4 全部可在浏览器内执行;交互式 7 步引导教学
- 离线 Demo + 双 Pages:Service Worker 缓存 App 外壳 + WASM 模块(首访后可离线);GitHub Pages + Gitee Pages(国内镜像,该平台 2026-09-15 停服下线)部署;SPA fallback
- 后端 feature flag:
?backend=wasm|http|mock强制切换模式(在线构建默认wasm) - 完整明细见 CHANGELOG
- 未登录访问引导修复:未登录直接访问市场/运行时/工作区/导出/导入导出/视图页时,统一引导至登录页(此前静默弹回首页,易误判"页面损坏");登录后页面可达性不变
- 测试工作台:规则试运行 + 结构化部署证据流(部署前验证规则行为)
- 知识数据面:
/knowledge路由 + 治理中心知识条目在线编辑(Draft 编辑/删除 + 新版本链) - 权限管理 UI:权限条目生命周期 + 判定测试台
- 模板市场 server 接线:项目方模板以 server 为唯一真相源 + 模板在线编辑 UI
- PDF 服务端渲染接线:Bearer 认证透传 + 降级原因显式上屏
- 15 项治理/执行 API 接线:审计导入/会话派生/回收/payload 注入/共享事实、执行台停止/中断、规则预检、沙盒报告、部署溯源、执行域规则、队列详情、会话清单、成员增删、服务清单等
- 平台用户打通:平台用户与 workspace 成员连接(幂等自动加入 + 403 显式加入重试)
- 「部署到执行域」:治理数据集 → 执行域发布链出口 UI
- 法规锚编辑通道:发布闸门问题的产品内修复路径
- 分类标签管理:抽屉式管理 + Escape 键盘关闭通道
- 场景示例规则 v2:业务指令范式 + 仓内 rules 预置(4 规则 9 用例实测全过)
- 规则编辑表单深化 + 校验器对齐权威 schema;旅程可用性整治 + 新项目方体验修复
- 完整明细见 CHANGELOG
- 规则库视图离线可用(内置 demo 数据集 + 4 个引导任务)
- 执行台 / 状态 / 审计 / 时间旅行:连接 evorule-server 运行(支持本地 / 远程地址)
- 平台登录接入(server 统一认证)+ 个人中心 + 权限判定后端化;用户管理 / 角色管理页(权限矩阵编辑器)
- 总览 Dashboard(widget 注册表化);导航注册表化(侧栏 / 跳单卡 / 命令面板同清单同门控)
- 历史会话审计档案面板 + 平台认证事件面板
- 云 LLM 辅助三用途:创建规则草案 / 解释规则 / 生成测试输入(9 家厂商预设)
- 联网模式切换(offline ↔ online)、视图选择、联网与 LLM 配置持久化
- apiKey 安全:仅存浏览器 localStorage,不进 URL / 日志 / 错误信息
| 目标 | 版本 | 说明 |
|---|---|---|
| 本地 LLM(L2) | 后续版本 | 付费扩展,本地 GPU LLM |
| 后续优化迭代 | 持续 | 依社区反馈完善 UI / 功能 / 文档 |
版本语义:
0.x为预发布系列,v1.0.0对应功能完整。欢迎通过 Issues 反馈需求与缺陷。
本仓不通过 npm 依赖内核。内核(evorule-console v0.2.0)实际使用的依赖闭包以源码快照形式内联在 src/lib/kernel/:
- 入口:
src/lib/kernel/index.ts(导出面与内核包对齐,省略未使用的模块) - 内容:backend 抽象与类型、rules/session/audit/view stores、AssistantProvider 扩展槽、RuleValidator、执行台/状态/审计/时间旅行视图及 ttd 组件
- 边界:快照后与本仓一同独立演进;内核仓的后续修改不会自动同步,需手动对照
git clone https://gitee.com/evorule/evorule-console-cloud.git
cd evorule-console-cloud
npm install
npm run dev # 开发者模式:http://localhost:5174(日常体验请用一键启动包,见下文)规则库视图不需要后端,可离线试用;执行台/状态/审计/时间旅行需要 evorule-server 跑在
localhost:18080(联网模式可配远程)。
.github/workflows/deploy-demo.yml 在 push 到 main 分支时自动构建并部署到 GitHub Pages。
首次启用步骤(GitHub):
- 进入 GitHub 仓 → Settings → Pages
- Source 选择 GitHub Actions(不是 "Deploy from a branch")
- 推一次 commit 到 main(或手动触发 workflow_dispatch)触发首次构建
- 部署完成后,URL 形如
https://<owner>.github.io/evorule-console-cloud/
特性:adapter-static 全量预渲染 + WasmBackend(真实 evorule 引擎编译为 WebAssembly),首访后零网络依赖,Service Worker 离线缓存,16 条业务规则在线 + 7 步引导教学。在线构建默认 ?backend=wasm;追加 ?backend=http|mock 可切换模式。
完整跑通执行台/状态/审计等视图需启动 evorule-server。注意 CORS 配置(关键踩坑,二选一):
- 方案 A(直连 +
--allowed-origins):evorule-server 启动时显式允许大众版 dev/preview 源(见下文启动顺序)。适用于 online 模式或生产部署。 - 方案 C(vite proxy,零配置):net-config 的 localBaseUrl 留空(同源),vite dev/preview 自动把
/api代理到127.0.0.1:18080(见vite.config.ts的server.proxy)。仅适用于 offline 本地开发,无需配 server。
-
启动 evorule-server(带 CORS 允许大众版 dev/preview 源)——在 evorule-server 仓目录下(已构建 release 二进制):
target\release\evorule-server.exe --addr 127.0.0.1:18080 \ --allowed-origins "http://localhost:5174,http://localhost:4173,http://127.0.0.1:5174,http://127.0.0.1:4173"
-
启动大众版 dev server——在本仓目录下:
npm run dev # http://localhost:5174 -
创建初始 session(让执行台 UI 显示提交区):
curl -X POST http://127.0.0.1:18080/api/sessions # → {"message":"Session created","session_id":1} -
浏览器打开:
http://localhost:5174/
npm run build
npm run preview -- --host 127.0.0.1 --port 4173| 坑 | 现象 | 解决 |
|---|---|---|
| CORS 跨域 | evorule-server 默认严格同源,跨端口被拒 | 方案 A:启动时加 --allowed-origins;方案 C:net-config 的 localBaseUrl 留空(同源),vite proxy 自动代理 /api → 127.0.0.1:18080(仅 dev/preview) |
| host 对齐 | localhost 与 127.0.0.1 是不同 origin |
大众版 net-config 默认 localhost:18080(与 vite dev 对齐);preview 用 --host 127.0.0.1 时需对应改 net-config |
| 端口占用 | e2e 测试后 npm run dev 报 Port 5174 is in use 或浏览器显示 “This site can't be reached” |
npm run clean && npm run dev(清理僵尸进程) |
| 空 sessions | evorule-server 启动后 sessions 为空,执行台 UI 不显示提交区 | 手动 POST /api/sessions 创建初始 session |
大众版 LLM apiKey 只走浏览器 localStorage(evorule-console-cloud:llm-config),不读 .env。在设置面板 → LLM 配置 tab 中填写。
内置 9 家厂商预设:智谱 GLM(推荐,有免费额度)/ 通义千问 / DeepSeek / MiniMax / Kimi / OpenAI / Ollama(本机)/ ERNIE / 自定义(任意 OpenAI 兼容端点)。推荐从 智谱开放平台 获取 apiKey 起步。
优先路径——平台登录:若 server 已启用平台用户体系(bootstrap 首启创建管理员),直接在登录页登录即可,无需手工填写 token。server 端开启 --demo-auth 时提供演示入口(server 下发开关控制显隐,server 不可达时保留)。
直连静态 token 场景:在设置面板 → 联网配置 → 认证 Token 中填入与 server 一致的 token(失焦自动保存,留空 = 请求不带凭据,仅免认证 server 可用)。全链路(执行侧会话 API、workspace 规则库、发布审批/回滚、生产状态/版本历史)统一携带 Authorization: Bearer 头。
server 侧两个 token 环境变量(详见 evorule-server README「环境变量 / CLI 参数」):
| 环境变量 | 语义 |
|---|---|
EVORULE_AUTH_TOKEN |
普通 Bearer token(浏览器用户身份);生产部署必须配置——未配置时认证整体关闭,受保护域写入准入失效(dev 放行语义) |
EVORULE_SERVICE_TOKEN |
service 身份 token(供服务间调用,如 evo-agent sidecar);受保护域 stable.llm.* / stable.system.* 仅此身份可写,浏览器端不应使用 |
注意事项:
- token 保存在本机浏览器 localStorage(与 LLM apiKey 同级取舍),请勿在共享设备填写;如需更高保证,将大众版部署在与 server 同源的反代后面并限制访问
- 连接测试(设置面板「测试连接」)会带上当前输入的 token,可直接验证凭据是否有效
- server 开启认证而本端未填 token 时,接口返回 401——先检查两侧 token 是否一致
完整测试说明(环境准备 → 4 种自动化测试 → evorule-server 联调 → LLM 联调 → 排查常见问题)见 CONTRIBUTING.md §测试要求。
快速跑全测试(提 PR 前必须全绿):
npm run check && npx vitest run && npm run test && npm run build| 测试 | 命令 | 实测结果(2026-09-06) |
|---|---|---|
| 类型检查 | npm run check |
0 errors / 0 warnings |
| 单元测试 | npx vitest run |
1214/1214(60 个测试文件) |
| e2e 测试 | npm run test |
5 个套件:navigation / settings-flow / assistant-flow / page-smoke / 步骤按钮回归 |
| 生产构建 | npm run build |
✅ build/ |
e2e 首次跑需先装浏览器:
npx playwright install chromiume2e 为什么workers: 1? 见 CONTRIBUTING.md §e2e 测试
npm run verify # vitest:验证 $lib/kernel 快照导入通路(CONSOLE_VERSION=0.2.0 + 所有导出可用)
npm run check # svelte-check:0 errors / 0 warnings
npm run test:unit # vitest:单元测试(assistant + backend + types + stores + governance …)
npm run test # playwright:e2e(navigation + settings-flow + assistant-flow + page-smoke + 回归)
npm run build # adapter-static:产出静态文件到 build/- SvelteKit 5 + Svelte 5(runes 模式)— 与内核对齐
- TypeScript(strict)
- Vite + adapter-static
- vitest(单元测试 + 导入验证)+ playwright(e2e)
- 内核快照
src/lib/kernel/(取自 evorule-console v0.2.0)
evorule-console-cloud/
├── src/
│ ├── routes/ # 17 条路由(workbench / governance / audit / knowledge /
│ │ # marketplace / users / roles / permissions / monitor /
│ │ # publish-queue / version-history / export / login / help …)
│ ├── lib/
│ │ ├── backend/ # CloudHttpBackend(联网/离线双模式)
│ │ ├── assistant/ # CloudLlmAssistant + llm-fetch + prompts + types
│ │ ├── config/ # net-config + llm-config + llm-presets(9 家预设) + governance-config + nav-registry
│ │ ├── data/ # demo 数据集 + 模板 + 引导任务
│ │ ├── governance/ # 治理后端 + store(发布/审批/审计,直连 evorule-rule :18081)
│ │ ├── stores/ # 跨视图共享状态(会话/数据集/导出/规则库/设置等)
│ │ ├── kernel/ # 内核源码快照(取自 evorule-console v0.2.0)
│ │ └── views/ # 25 个视图组件
│ ├── app.css # 设计令牌(与内核对齐,深色主题)
│ └── verify.test.ts # 导入验证(vitest)
├── tests/ # playwright e2e(5 套件)
├── docs/ # 公开文档(Diátaxis 四类 + ADR + 场景示例)
├── package.json # 依赖声明(内核已内联,无 npm 内核依赖)
├── svelte.config.js # adapter-static
├── vite.config.ts # port 5174
└── README.md(本文件)
AGPL-3.0-or-later + 商业双许可 — 详见 LICENSE / DUAL_LICENSE.md。
商业许可咨询:evorulelab@gmail.com
| 文件 | 说明 |
|---|---|
| NOTICE.md | 声明(与 evorule-console 内核的关系) |
| CHANGELOG.md | 变更记录 |
| CONTRIBUTING.md | 贡献指南(含核心原则 + 禁止事项) |
| SECURITY.md | 安全政策(含 LLM apiKey 安全设计) |
| RELEASE_PROCESS.md | 发布流程 |
| AUTHORS.md | 作者 |
| CODE_OF_CONDUCT.md | 贡献者公约 |
| TRADEMARK.md | 商标政策 |
| CLA-individual.md | 个人贡献者许可协议 |
| COMMERCIAL_LICENSE.md | 商业许可 |
| FREE_COMMERCIAL_LICENSE.md | 免费商业豁免资格 |
本生态以 Gitee 为主仓,GitHub 为同步镜像——Issue 与 PR 请提交到 Gitee。
Copyright (C) 2026 EvoRule Project. All rights reserved.