Skip to content

Commit 7b3df87

Browse files
authored
Align OpenRath v2.0.0 README and deployment reference (#52)
1 parent ee3a8e2 commit 7b3df87

10 files changed

Lines changed: 131 additions & 35 deletions

File tree

.github/workflows/ci-v2-production.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
server /data
4848
- run: uv lock --check
4949
- run: uv sync --frozen --extra postgres --extra server --extra s3 --extra redis --extra otel
50-
- run: uv run ruff check src tests scripts examples
50+
- run: uv run ruff check src tests scripts deploy/reference_app.py
5151
- run: uv run ruff format --check src tests example
5252
- run: uv run mypy src/rath
5353
- name: Audit exact production dependency set

.github/workflows/release-v2-ga.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
uv lock --check
121121
uv sync --frozen --all-extras --all-groups
122122
uv run ruff format --check src tests example
123-
uv run ruff check src tests scripts examples
123+
uv run ruff check src tests scripts deploy/reference_app.py
124124
uv run mypy --no-incremental src/rath
125125
uv run pytest -q -n auto \
126126
-m "not live_llm and not opensandbox and not openviking"

.github/workflows/release-v2-rc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
uv lock --check
5656
uv sync --frozen --all-extras --all-groups
5757
uv run ruff format --check src tests example
58-
uv run ruff check src tests scripts examples
58+
uv run ruff check src tests scripts deploy/reference_app.py
5959
uv run mypy --no-incremental src/rath
6060
uv run pytest -q -n auto -m "not live_llm and not opensandbox and not openviking"
6161
uv run python scripts/export_openapi_v2.py --output "$RUNNER_TEMP/openapi-v2.json"

README.md

Lines changed: 59 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,40 @@ Most agent frameworks begin with an agent loop. OpenRath begins with **Session**
5454

5555
OpenRath is designed for this: many agents collaborating across many branchable sessions, while still tracing every role, workspace, memory write, and final output.
5656

57-
## v2.0.0 durable runtime (release candidate)
58-
59-
The `2.0.0rc1` candidate adds explicit `@step` / `@router` execution plans, durable
60-
Runs and checkpoints, effect reconciliation, tenant-scoped Agent Server APIs,
61-
and governed Provider/Tool/Sandbox/Memory adapters. The HTTP contract is
62-
currently **Beta**; v1 JSONL imports are historical and cannot resume an active
63-
Run.
57+
## OpenRath v2.0.0: Built for Production
58+
59+
The defining change in OpenRath v2.0.0 is that OpenRath moves beyond a
60+
composable Python framework and becomes a durable runtime designed for
61+
production deployment. The existing Session-first Python API remains intact;
62+
the release adds a production execution and operations layer around it.
63+
64+
| Production concern | What OpenRath provides |
65+
| --- | --- |
66+
| Durable execution | Explicit `@step` / `@router` boundaries compile into immutable execution plans. Runs, Events, and Checkpoints survive process and worker restarts. |
67+
| Resilient workers | Leases, fencing, retries, cancellation, deadlines, and resumable queues prevent stale workers from silently committing new state. |
68+
| Controlled side effects | An Effect Ledger records outcomes and idempotency keys. Ambiguous non-idempotent effects stop in `NEEDS_REVIEW` instead of being replayed blindly. |
69+
| Human decisions | Durable Interrupts pause a Run for approval or input and resume it without rebuilding hidden loop state. |
70+
| Security and tenancy | Agent Server tokens carry explicit action grants; tenant/project scope, policy checks, secret references, trust labels, and audit remain separate boundaries. |
71+
| Production operations | PostgreSQL is the durable source of truth, Redis can accelerate signaling, S3-compatible storage holds artifacts, and health, migration, telemetry, container, and Kubernetes references are included. |
72+
73+
```text
74+
@step / @router
75+
|
76+
v
77+
ExecutionPlan -> Run -> Event -> Checkpoint
78+
| |
79+
| +-> Interrupt / Effect Ledger
80+
|
81+
+-> PostgreSQL durable state
82+
+-> optional Redis signals
83+
+-> S3-compatible artifacts
84+
|
85+
v
86+
Agent Server HTTP + SSE
87+
```
6488

65-
Embedded mode is intended for a trusted process. Agent Server mode is the
66-
strict durable profile: tokens need explicit action grants, object access is
67-
tenant/project scoped, and synchronous steps cannot declare a preemptive
68-
timeout. Use an async step or isolated executor for enforceable deadlines.
89+
Embedded mode remains useful inside a trusted process. Agent Server mode is the
90+
strict production profile:
6991

7092
```python
7193
runtime = LocalRuntime(
@@ -76,12 +98,28 @@ runtime = LocalRuntime(
7698
server = AgentServer(store, runtime, auth=auth, audit_sink=audit)
7799
```
78100

79-
Production PostgreSQL schema migration is a separate operation:
80-
`openrath-migrate` followed by `openrath-migrate --check`. Runtime identities
81-
do not need DDL privileges. See
82-
[`deploy/docs/operations-v2.md`](deploy/docs/operations-v2.md),
83-
[`deploy/docs/migration-v2.md`](deploy/docs/migration-v2.md), and the generated
84-
[`deploy/docs/openapi-v2.json`](deploy/docs/openapi-v2.json).
101+
Install the production profile and run schema migration as a separate
102+
operation:
103+
104+
```bash
105+
pip install "openrath[server,postgres]"
106+
openrath-migrate
107+
openrath-migrate --check
108+
```
109+
110+
Runtime identities do not need DDL privileges. Tokens need explicit action
111+
grants, object access is tenant/project scoped, and synchronous steps cannot
112+
declare a preemptive timeout; use an async step or isolated executor when a
113+
deadline must be enforced.
114+
115+
OpenRath v2.0.0 is designed for production deployment while keeping interface
116+
maturity explicit: the Agent Server HTTP surface remains **Beta**, and v1 JSONL
117+
imports are historical records rather than resumable active Runs. Deployment,
118+
migration, security, and operations guidance lives in
119+
[`deploy/`](deploy/), including
120+
[`operations-v2.md`](deploy/docs/operations-v2.md),
121+
[`migration-v2.md`](deploy/docs/migration-v2.md), and the generated
122+
[`openapi-v2.json`](deploy/docs/openapi-v2.json).
85123

86124
<p align="center">
87125
<img src="assets/readme/diagrams/paradigm-map.png" alt="Multi-Agent Multi-Session Map" width="860" />
@@ -344,6 +382,10 @@ python example/01_hello_agent.py
344382

345383
Read [`example/README.md`](example/README.md) for setup details and shared helpers.
346384

385+
For complete, production-shaped scenarios with fixed inputs, durable state, QA,
386+
and committed deliverables, see
387+
[`Rath-Team/OpenRath-Example`](https://github.com/Rath-Team/OpenRath-Example).
388+
347389
---
348390

349391
## Docs and Links

README_zh.md

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,67 @@
5454

5555
OpenRath 为此而设计:多个 Agent 在多个可分支 Session 上协作,同时仍能追踪每个 role、workspace、memory 写入和最终输出。
5656

57-
## v2.0.0 durable runtime(候选版本)
57+
## OpenRath v2.0.0:面向生产环境
58+
59+
OpenRath v2.0.0 最重要的变化,是 OpenRath 从一个可组合的 Python 框架,
60+
进入可部署、可恢复、可运维的生产环境。原有以 Session 为核心的 Python API
61+
保持不变;这个版本在其外层增加了一套生产级执行与运维体系。
62+
63+
| 生产环境关注点 | OpenRath 提供的能力 |
64+
| --- | --- |
65+
| 持久化执行 | 显式的 `@step` / `@router` 边界会编译成不可变执行计划;Run、Event 与 Checkpoint 能跨进程和 Worker 重启保留。 |
66+
| Worker 故障恢复 | Lease、Fencing、Retry、Cancellation、Deadline 与可恢复队列,防止过期 Worker 静默提交新状态。 |
67+
| 受控副作用 | Effect Ledger 记录执行结果与幂等键;无法确认的非幂等副作用会停在 `NEEDS_REVIEW`,而不是被盲目重放。 |
68+
| 人工决策 | 持久化 Interrupt 可以暂停 Run 等待审批或输入,并在不重建隐藏循环状态的情况下恢复。 |
69+
| 安全与租户隔离 | Agent Server Token 使用显式 Action Grant;Tenant/Project Scope、Policy、Secret Reference、Trust Label 与 Audit 保持为独立边界。 |
70+
| 生产运维 | PostgreSQL 是持久化事实来源,Redis 可加速信号传递,S3 兼容存储保存 Artifact,并提供健康检查、迁移、遥测、容器与 Kubernetes 参考。 |
71+
72+
```text
73+
@step / @router
74+
|
75+
v
76+
ExecutionPlan -> Run -> Event -> Checkpoint
77+
| |
78+
| +-> Interrupt / Effect Ledger
79+
|
80+
+-> PostgreSQL 持久化状态
81+
+-> 可选 Redis 信号
82+
+-> S3 兼容 Artifact
83+
|
84+
v
85+
Agent Server HTTP + SSE
86+
```
87+
88+
Embedded mode 仍适合可信进程内部使用。Agent Server mode 是严格的生产
89+
Profile:
5890

59-
`2.0.0rc1` 新增显式 `@step` / `@router` 执行计划、durable Run 与
60-
Checkpoint、effect reconciliation、tenant-scoped Agent Server API,以及受
61-
治理的 Provider/Tool/Sandbox/Memory adapter。HTTP contract 在 RC 阶段仍为
62-
**Beta**;v1 JSONL 导入仅作为历史记录,不能恢复 active Run。
91+
```python
92+
runtime = LocalRuntime(
93+
store,
94+
effect_ledger=ledger,
95+
production_mode=True,
96+
)
97+
server = AgentServer(store, runtime, auth=auth, audit_sink=audit)
98+
```
6399

64-
Embedded mode 面向可信本地进程。Agent Server mode 是严格的 durable
65-
profile:token 必须具有显式 action grants,对象访问按 tenant/project
66-
隔离;需要强制 deadline 时应使用 async step 或 isolated executor。
100+
安装生产 Profile,并将数据库 Schema 迁移作为独立操作执行:
101+
102+
```bash
103+
pip install "openrath[server,postgres]"
104+
openrath-migrate
105+
openrath-migrate --check
106+
```
107+
108+
运行时身份不需要 DDL 权限。Token 必须拥有显式 Action Grant,对象访问按
109+
Tenant/Project 隔离;同步 Step 不能声明抢占式超时,需要强制 Deadline 时应使用
110+
Async Step 或隔离执行器。
111+
112+
OpenRath v2.0.0 面向生产部署,同时明确标注接口成熟度:Agent Server HTTP
113+
接口仍为 **Beta**;v1 JSONL 导入属于历史记录,不能恢复 Active Run。部署、
114+
迁移、安全和运维指南位于 [`deploy/`](deploy/),包括
115+
[`operations-v2.md`](deploy/docs/operations-v2.md)
116+
[`migration-v2.md`](deploy/docs/migration-v2.md) 和生成的
117+
[`openapi-v2.json`](deploy/docs/openapi-v2.json)
67118

68119
<p align="center">
69120
<img src="assets/readme/diagrams/paradigm-map.png" alt="多智能体多会话映射" width="860" />
@@ -326,6 +377,9 @@ python example/01_hello_agent.py
326377

327378
阅读 [`example/README.md`](example/README.md) 获取设置细节和共享 helpers。
328379

380+
如需查看包含固定输入、持久化状态、质量检查和已提交交付物的完整生产化场景,
381+
请访问 [`Rath-Team/OpenRath-Example`](https://github.com/Rath-Team/OpenRath-Example)
382+
329383
---
330384

331385
## 文档与链接

deploy/compose/compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ services:
2626
dockerfile: docker/Dockerfile
2727
image: openrath:2.0.0rc1
2828
environment:
29-
OPENRATH_APP: examples.v2_server_app:app
29+
OPENRATH_APP: reference_app:app
3030
OPENRATH_POSTGRES_DSN: postgresql://openrath:${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD}@postgres:5432/openrath
3131
OPENRATH_TOKEN: ${OPENRATH_TOKEN:?set OPENRATH_TOKEN}
3232
OPENRATH_TENANT_ID: ${OPENRATH_TENANT_ID:-default}
@@ -61,7 +61,7 @@ services:
6161
dockerfile: docker/Dockerfile
6262
image: openrath:2.0.0rc1
6363
entrypoint: ["openrath-worker"]
64-
command: ["--app", "examples.v2_server_app:server"]
64+
command: ["--app", "reference_app:server"]
6565
environment:
6666
OPENRATH_POSTGRES_DSN: postgresql://openrath:${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD}@postgres:5432/openrath
6767
OPENRATH_TOKEN: ${OPENRATH_TOKEN:?set OPENRATH_TOKEN}

deploy/kubernetes/openrath.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ kind: ConfigMap
1515
metadata:
1616
name: openrath
1717
data:
18-
OPENRATH_APP: examples.v2_server_app:app
18+
OPENRATH_APP: reference_app:app
1919
OPENRATH_EMBEDDED_WORKER: "false"
2020
OPENRATH_DB_SCHEMA: openrath
2121
OPENRATH_TENANT_ID: default
@@ -163,7 +163,7 @@ spec:
163163
image: ghcr.io/rath-team/openrath:2.0.0rc1
164164
# Release automation must replace the review tag with image@sha256.
165165
imagePullPolicy: Always
166-
command: ["openrath-worker", "--app", "examples.v2_server_app:server"]
166+
command: ["openrath-worker", "--app", "reference_app:server"]
167167
envFrom:
168168
- configMapRef:
169169
name: openrath
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Minimal standalone OpenRath v2 reference application."""
1+
"""Minimal deployable OpenRath v2 reference application."""
22

33
from __future__ import annotations
44

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ RUN groupadd --system --gid 10001 openrath \
3232
&& useradd --system --uid 10001 --gid openrath --home /app openrath
3333
WORKDIR /app
3434
COPY --from=builder /opt/venv /opt/venv
35-
COPY examples ./examples
35+
COPY deploy/reference_app.py ./reference_app.py
3636
USER 10001:10001
3737
EXPOSE 8000
3838
ENTRYPOINT ["openrath-server"]

tests/deployment/test_reference_manifests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_kubernetes_template_covers_workloads_and_dns() -> None:
2828

2929

3030
def test_reference_server_enables_audit_and_explicit_grants() -> None:
31-
app = Path("examples/v2_server_app.py").read_text(encoding="utf-8")
31+
app = Path("deploy/reference_app.py").read_text(encoding="utf-8")
3232
compose = Path("deploy/compose/compose.yaml").read_text(encoding="utf-8")
3333
assert "StructuredAuditSink()" in app
3434
assert 'os.environ["OPENRATH_GRANTS"]' in app

0 commit comments

Comments
 (0)