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
61 changes: 61 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,64 @@ pin an exact commit or tag for every distribution.
visual-novel adapters. Installation, save/load, forced termination,
multiplayer authority, emergency stop, UI, long-play, and character
naturalness still require human acceptance.

## [0.6.0] - 2026-07-24 - Preview

This entry records the behavior of the `v0.6.0` tag. It describes the retired
V1 architecture and is retained as release history, not as current V2 usage
documentation.

### Added

- A game-authoritative Observation -> Proposal -> apply/reject -> Commit
lifecycle, including late outcome merging and durable game-side Outbox
recovery.
- Durable, lineage-wide request and event ID history, exact retry results,
revision replay, internal replay checkpoints, `rin inspect`, and explicit
full-history verification.
- Feature-gated memory archives, actor-local beliefs and goals, actor activity,
world arbitration, and atomic batch outcome reporting.
- Asynchronous Proposal and structured Generation Jobs with bounded queues,
retention, cancellation, provider retries, and circuit breaking.
- Source-first Python, JavaScript, C#, Java, and Lua clients; an OpenAPI 3.1
wire schema; and engine integration examples available at that release.

### Changed

- New Sessions could opt into late outcome reporting while existing Sessions
retained their historical reducer and Commit semantics.
- Restore required an `expected_binding` from the running game's trusted
content manifest and checked it against both the imported Snapshot and an
existing target Session.
- `rin.reducer-projection/v2` reconstructed Proposal presentation without
rewriting authoritative event bytes.
- The bundled File Store added lazy Session loading, a revision index, and
derived checkpoints while retaining the event log indefinitely.

### Security

- Inline Snapshot JSON was capped at 16 MiB; default request and bundled client
response bodies were capped at 32 MiB. Oversized input was rejected rather
than truncated.
- Provider prompts, credentials, and raw HTTP bodies were excluded from errors,
logs, and durable Session state.
- Public HTTP JSON integers used the exact interoperable range, Commit
acceptance required an explicit field, and malformed UTF-8 or Unicode in
game-facing and successful provider JSON was rejected before decoding.
- Snapshot, checkpoint, and event hashes were documented as unkeyed checksums,
not signatures or proof against an adversarial history rewrite.

### Compatibility notes

- This was a pre-1.0 Preview contract. Distributions needed to pin the Sidecar,
client source, and conformance inventory to the same repository revision.
- Requests rejected unknown fields while clients were expected to tolerate
additive response fields. SDKs were source-first and were not published to
language registries.
- Complete Snapshots had no streaming transport. The bundled File Store was
supported only on local `darwin` and `linux` filesystems.

## Earlier implementation milestones

Repository history also contains milestones named 0.1 through 0.5. They were
development phases, not evidence that corresponding public release tags exist.
52 changes: 52 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,55 @@ Commit 或 Tag。
- Rin Go 核心、Race、OpenAPI、五语言 SDK 和三个 V2 示例具备自动化门禁。
- Minecraft 与视觉小说两个真实 Adapter 的自动契约与跨进程回归已通过;安装、存读档、
强制终止、多人权限、急停、UI、长时间游玩和角色自然度仍需人工验收。

## [0.6.0] - 2026-07-24 - Preview

本节记录 `v0.6.0` Tag 当时的行为。它描述的是已经退役的 V1 架构,仅作为发布历史
保留,不是当前 V2 的使用文档。

### 新增

- 由游戏掌握权威的 Observation -> Proposal -> Apply/Reject -> Commit 生命周期,
包括延迟 Outcome 合并和游戏侧持久 Outbox 恢复。
- 覆盖完整 Lineage 的持久 Request/Event ID History、Exact Retry 结果、指定 Revision
Replay、内部重放 Checkpoint、`rin inspect` 和显式全历史校验。
- 由 Feature 控制的 Memory Archive、Actor 本地 Belief 与 Goal、Actor Activity、
世界仲裁和原子 Batch Outcome。
- 具有有界队列、保留、取消、Provider 重试和熔断的异步 Proposal 与结构化
Generation Job。
- 源码优先的 Python、JavaScript、C#、Java、Lua Client、一份 OpenAPI 3.1 Wire
Schema,以及该版本发布时提供的引擎接入示例。

### 变化

- 新 Session 可启用延迟 Outcome 上报;既有 Session 保持原有 Reducer 与 Commit
语义。
- Restore 要求提供运行中游戏可信内容 Manifest 的 `expected_binding`,并同时核对
导入 Snapshot 与已存在的目标 Session。
- `rin.reducer-projection/v2` 可重建 Proposal 展示内容,同时不改写权威事件字节。
- 随附 File Store 增加 Session Lazy Load、Revision Index 和派生 Checkpoint,并继续
永久保留事件日志。

### 安全

- Inline Snapshot JSON 上限为 16 MiB;默认请求正文和随附 Client 响应正文上限为
32 MiB。超限输入会被拒绝,而不是截断。
- Provider Prompt、凭据和原始 HTTP 正文不会进入错误、日志或持久 Session State。
- 公共 HTTP JSON 整数使用可精确跨语言表示的范围;Commit 接受结果要求显式字段;
游戏侧请求及成功 Provider JSON 中的非法 UTF-8 或 Unicode 会在解码前被拒绝。
- Snapshot、Checkpoint 与 Event Hash 被明确视为无密钥 Checksum,而不是签名或对抗
历史重写的证明。

### 兼容说明

- 这是 pre-1.0 Preview 契约。分发时需要把 Sidecar、Client 源码和 Conformance
Inventory 固定到同一仓库 Revision。
- 请求拒绝未知字段,Client 则应容忍响应中的增量字段。SDK 采用源码优先分发,未发布
到各语言 Registry。
- 完整 Snapshot 没有流式传输;随附 File Store 仅支持 `darwin` 与 `linux` 的本地
文件系统。

## 更早的实施里程碑

仓库历史中还存在名为 0.1 至 0.5 的实施里程碑。它们是开发阶段,不表示存在对应的
公共 Release Tag。
29 changes: 20 additions & 9 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,19 @@ Core invariants:

## Build locally

Go `1.25` or newer is required. Other language runtimes are needed only when
testing their SDKs.
Building the core binaries requires Go `1.25` or newer:

```bash
make verify
make build
```

The full maintainer verification gate also requires Node.js, Python, the .NET
SDK, a JDK, and Lua:

```bash
make verify
```

The `bin/` directory then contains:

- `rin`: the unified `serve`, `console`, MCP management, Host scaffolding,
Expand Down Expand Up @@ -106,6 +111,8 @@ actors, operations, long goals, and a readable task timeline, and it manages the
shared default persona and common memory cards. Common cards are retrievable by
internal Agents attached to the same Rin instance; game canon, actor-private
memory, and an external Agent's private memory do not become cross-game state.
The Console also manages learned skills, the internal model, optional remote
embeddings, and general gameplay policy.

## Connect external Agents

Expand All @@ -131,9 +138,9 @@ creates a contract skeleton without downloading dependencies or pretending to
provide an engine integration.

```bash
./bin/rin init host -engine custom -runtime java -id my-game-host -output ./my-game-host
./bin/rin conformance host -project ./my-game-host
./bin/rin doctor host -project ./my-game-host
./bin/rin init host -engine custom -runtime java -id my_game_host -output ./my-game-host
./bin/rin conformance host -path ./my-game-host
./bin/rin doctor host -path ./my-game-host
```

A complete adapter supplies trusted observations, capability discovery, target
Expand Down Expand Up @@ -166,15 +173,19 @@ and adapter path.
- [Roadmap](ROADMAP.en.md)

The OpenAPI files are the sole HTTP route and field sources of truth:
`api/control-openapi.json` and `api/agent-openapi.json`.
`api/control-openapi.json`, `api/agent-openapi.json`,
`api/management-openapi.json`, `api/signal-openapi.json`, and
`api/task-plan-openapi.json`.

## Security boundary

Rin does not execute model-generated code, expose engine objects to models, or
allow controllers to declare effects. The built-in safety kernel denies effects
for arbitrary code, file access, native calls, authority forgery, and secret
exposure. API keys enter through process environment only and must never appear
in Agent configuration, game saves, observations, or MCP output.
exposure. Model and embedding provider keys must never appear in public Agent
configuration, game saves, observations, or MCP output. They may come from
environment variables or a separate mode-`0600` secret file written by the
local Console; environment variables take precedence.

See [SECURITY.en.md](SECURITY.en.md) for the threat model.

Expand Down
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,18 @@ flowchart LR

## 本地构建

要求 Go `1.25` 或更高版本。其他语言运行时只在测试对应 SDK 时需要。
构建核心二进制要求 Go `1.25` 或更高版本

```bash
make verify
make build
```

运行完整维护者门禁还需要 Node.js、Python、.NET SDK、JDK 和 Lua:

```bash
make verify
```

产物位于 `bin/`:

- `rin`:统一入口,包含 `serve`、`console`、MCP 管理、Host 脚手架、Conformance 和 Doctor。
Expand Down Expand Up @@ -115,9 +120,9 @@ Console 还可管理 learned Skill、内部模型、可选远程 Embedding 与
或伪造引擎集成:

```bash
./bin/rin init host -engine custom -runtime java -id my-game-host -output ./my-game-host
./bin/rin conformance host -project ./my-game-host
./bin/rin doctor host -project ./my-game-host
./bin/rin init host -engine custom -runtime java -id my_game_host -output ./my-game-host
./bin/rin conformance host -path ./my-game-host
./bin/rin doctor host -path ./my-game-host
```

完整 Adapter 需要实现可信观察、能力发现、目标绑定、Effect Preview、权威执行、取消和结果验证。
Expand Down Expand Up @@ -147,8 +152,9 @@ Control、Policy、Operation 与 Adapter 链路。
- [路线图](ROADMAP.md)

OpenAPI 文件是 HTTP 字段与路由的唯一事实来源:
`api/control-openapi.json`、`api/agent-openapi.json` 和
`api/management-openapi.json`。
`api/control-openapi.json`、`api/agent-openapi.json`、
`api/management-openapi.json`、`api/signal-openapi.json` 和
`api/task-plan-openapi.json`。

## 安全边界

Expand Down
15 changes: 12 additions & 3 deletions SECURITY.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,21 @@ and adapter pre-execution validation must reject it.

## Providers and secrets

Internal Agent configuration files must not contain API keys. Credentials enter
the process only through:
Internal Agent configuration files must not contain API keys. Credentials can
enter the process through these environment variables:

- `RIN_CONTROL_TOKEN` for the Control API;
- `RIN_AGENT_TOKEN` for the Agent Task API, distinct from the Control token;
- `RIN_AGENT_API_KEY` for an optional model provider, distinct from both daemon tokens.
- `RIN_AGENT_API_KEY` for an optional model provider, distinct from both daemon tokens;
- `RIN_AGENT_EMBEDDING_API_KEY` for optional remote embeddings, distinct from both daemon tokens.

The loopback Rin Console can also store the two provider keys in
`<data>/agent/agent-secrets.json`. This file is separate from public Agent
configuration, is atomically written in a private directory with mode `0600`,
and is never returned by the API; responses expose presence only. The matching
environment variable overrides a saved value. This local store provides only
operating-system user-level protection and must not be placed in a synchronized
directory, game save, or repository.

Remote model URLs require HTTPS; only loopback providers may use HTTP. URLs may
not contain user information. The provider client rejects redirects and bounds
Expand Down
49 changes: 38 additions & 11 deletions THIRD-PARTY-NOTICES.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,44 @@
# Third-party notices

Rin is licensed under the [MIT License](LICENSE). The Go module also uses the
following third-party packages under their own terms:
Rin is licensed under the [MIT License](LICENSE). The table below is the union
of external Go modules linked by CGO-disabled builds of `cmd/rin`,
`cmd/rin-control`, and `cmd/rin-mcp` for `darwin/arm64`, `linux/amd64`, and
`windows/amd64`. It was derived from `go list -deps`; test-only and tool-only
modules are excluded.

| Module | Version | License | Source and license text |
License labels are summaries of the license files in the downloaded module
archives, not replacements for those terms. `all` means the module is in the
dependency closure of all three commands on at least one evaluated target;
otherwise the table names the only command that links the module. Target-
specific dependency pruning can still omit a listed module from one artifact.

| Module | Version | Linked by | License files verified in module archive |
| --- | --- | --- | --- |
| `github.com/modelcontextprotocol/go-sdk` | `v1.7.0-pre.3` | MIT | [source](https://github.com/modelcontextprotocol/go-sdk/tree/v1.7.0-pre.3), [license](https://github.com/modelcontextprotocol/go-sdk/blob/v1.7.0-pre.3/LICENSE) |
| `github.com/santhosh-tekuri/jsonschema/v6` | `v6.0.2` | Apache-2.0 | [source](https://github.com/santhosh-tekuri/jsonschema/tree/v6.0.2), [license](https://github.com/santhosh-tekuri/jsonschema/blob/v6.0.2/LICENSE) |
| `go.yaml.in/yaml/v3` | `v3.0.5` | MIT and Apache-2.0 | [source](https://github.com/yaml/go-yaml/tree/v3.0.5), [license](https://github.com/yaml/go-yaml/blob/v3.0.5/LICENSE) |
| `modernc.org/sqlite` | `v1.56.0` | BSD-3-Clause | [source](https://gitlab.com/cznic/sqlite/-/tree/v1.56.0), [license](https://gitlab.com/cznic/sqlite/-/blob/v1.56.0/LICENSE) |
| `golang.org/x/text` | `v0.39.0` | BSD-3-Clause | [source](https://cs.opensource.google/go/x/text/+/v0.39.0), [license](https://cs.opensource.google/go/x/text/+/v0.39.0:LICENSE) |
| [`github.com/dustin/go-humanize`](https://pkg.go.dev/github.com/dustin/go-humanize@v1.0.1) | `v1.0.1` | all | MIT (`LICENSE`) |
| [`github.com/google/jsonschema-go`](https://pkg.go.dev/github.com/google/jsonschema-go@v0.4.3) | `v0.4.3` | `rin-mcp` | MIT (`LICENSE`) |
| [`github.com/google/uuid`](https://pkg.go.dev/github.com/google/uuid@v1.6.0) | `v1.6.0` | all | BSD-3-Clause (`LICENSE`) |
| [`github.com/mattn/go-isatty`](https://pkg.go.dev/github.com/mattn/go-isatty@v0.0.24) | `v0.0.24` | all | MIT (`LICENSE`) |
| [`github.com/modelcontextprotocol/go-sdk`](https://pkg.go.dev/github.com/modelcontextprotocol/go-sdk@v1.7.0-pre.3) | `v1.7.0-pre.3` | `rin-mcp` | Apache-2.0 and MIT (`LICENSE`) |
| [`github.com/ncruces/go-strftime`](https://pkg.go.dev/github.com/ncruces/go-strftime@v1.0.0) | `v1.0.0` | all | MIT (`LICENSE`) |
| [`github.com/remyoudompheng/bigfft`](https://pkg.go.dev/github.com/remyoudompheng/bigfft@v0.0.0-20230129092748-24d4a6f8daec) | `v0.0.0-20230129092748-24d4a6f8daec` | all | BSD-3-Clause (`LICENSE`) |
| [`github.com/santhosh-tekuri/jsonschema/v6`](https://pkg.go.dev/github.com/santhosh-tekuri/jsonschema/v6@v6.0.2) | `v6.0.2` | all | Apache-2.0 (`LICENSE`) |
| [`github.com/segmentio/asm`](https://pkg.go.dev/github.com/segmentio/asm@v1.1.3) | `v1.1.3` | `rin-mcp` | MIT (`LICENSE`) |
| [`github.com/segmentio/encoding`](https://pkg.go.dev/github.com/segmentio/encoding@v0.5.4) | `v0.5.4` | `rin-mcp` | MIT (`LICENSE`) |
| [`github.com/yosida95/uritemplate/v3`](https://pkg.go.dev/github.com/yosida95/uritemplate/v3@v3.0.2) | `v3.0.2` | `rin-mcp` | BSD-3-Clause (`LICENSE`) |
| [`go.yaml.in/yaml/v3`](https://pkg.go.dev/go.yaml.in/yaml/v3@v3.0.5) | `v3.0.5` | all | MIT and Apache-2.0 (`LICENSE`, `NOTICE`) |
| [`golang.org/x/oauth2`](https://pkg.go.dev/golang.org/x/oauth2@v0.35.0) | `v0.35.0` | `rin-mcp` | BSD-3-Clause (`LICENSE`) |
| [`golang.org/x/sync`](https://pkg.go.dev/golang.org/x/sync@v0.21.0) | `v0.21.0` | `rin-mcp` | BSD-3-Clause (`LICENSE`) |
| [`golang.org/x/sys`](https://pkg.go.dev/golang.org/x/sys@v0.47.0) | `v0.47.0` | all | BSD-3-Clause (`LICENSE`) |
| [`golang.org/x/text`](https://pkg.go.dev/golang.org/x/text@v0.39.0) | `v0.39.0` | all | BSD-3-Clause (`LICENSE`) |
| [`golang.org/x/time`](https://pkg.go.dev/golang.org/x/time@v0.15.0) | `v0.15.0` | `rin-mcp` | BSD-3-Clause (`LICENSE`) |
| [`modernc.org/libc`](https://pkg.go.dev/modernc.org/libc@v1.74.4) | `v1.74.4` | all | BSD-3-Clause plus component terms (`LICENSE`, `LICENSE-3RD-PARTY.md`) |
| [`modernc.org/mathutil`](https://pkg.go.dev/modernc.org/mathutil@v1.7.1) | `v1.7.1` | all | BSD-3-Clause (`LICENSE`, `mersenne/LICENSE`) |
| [`modernc.org/memory`](https://pkg.go.dev/modernc.org/memory@v1.11.0) | `v1.11.0` | all | BSD-3-Clause plus component notices (`LICENSE`, `LICENSE-MMAP-GO`, `LICENSE-GO`, `LICENSE-LOGO`) |
| [`modernc.org/sqlite`](https://pkg.go.dev/modernc.org/sqlite@v1.56.0) | `v1.56.0` | all | BSD-3-Clause (`LICENSE`) |

The versions in `go.mod` and integrity hashes in `go.sum` are authoritative.
Go module downloads include each dependency's complete license file. Binary
distributors must reproduce the applicable license and attribution text in
their distribution materials.
Build tags, target operating systems, or dependency changes can alter a
binary's dependency closure. Release packaging should therefore regenerate
this inventory for every distributed target and include the complete
applicable license, notice, copyright, and attribution texts from the exact
module archives used to build it.
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ contracts. Documentation examples never replace authoritative game-adapter check
10. [Signal inbox](signals.md): receive short-lived Host attention hints for internal wake-up or external MCP reads.
11. [Host scaffolding](host-scaffolding.md): generate a contract skeleton for a language and engine.
12. [Integration acceptance](host-integration-validation.md): automated gates and human game testing.
13. [Milestone A validation report](milestone-a-validation.md): current architecture,
cross-adapter evidence, performance, and remaining human checks.

Additional material:

Expand All @@ -36,6 +34,8 @@ Additional material:
| Host `rin.host/v2` | `host/*.go` |
| Control `rin.control/v2` | `api/control-openapi.json`, `controlplane/*.go` |
| Agent Task API `v1` | `api/agent-openapi.json`, `agentapi/*.go` |
| Management `rin.management/v1` | `api/management-openapi.json`, `managementapi/*.go` |
| Task Plan `rin.task-plan/v1` | `api/task-plan-openapi.json`, `taskstate/*.go` |
| Task timeline `v1` | `timeline/*.go`, `api/task-timeline-v1-fixtures.json` |
| Signal `rin.signal/v1` | `signalbox/*.go`, `api/signal-openapi.json` |
| MCP tools | `mcpbridge/server.go` |
Expand Down
4 changes: 2 additions & 2 deletions docs/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
10. [Signal 收件箱](signals.zh-CN.md):由 Host 发布短期注意提示,供内部唤醒或外部 MCP 读取。
11. [Host 脚手架](host-scaffolding.zh-CN.md):生成契约骨架并接入自己的语言与引擎。
12. [集成验收](host-integration-validation.zh-CN.md):自动门禁与真人游戏测试。
13. [里程碑 A 验收报告](milestone-a-validation.zh-CN.md):当前架构、跨 Adapter 证据、性能与
仍需真人确认的项目。

补充资料:

Expand All @@ -35,6 +33,8 @@
| Host `rin.host/v2` | `host/*.go` |
| Control `rin.control/v2` | `api/control-openapi.json`、`controlplane/*.go` |
| Agent Task API `v1` | `api/agent-openapi.json`、`agentapi/*.go` |
| Management `rin.management/v1` | `api/management-openapi.json`、`managementapi/*.go` |
| Task Plan `rin.task-plan/v1` | `api/task-plan-openapi.json`、`taskstate/*.go` |
| Task Timeline `v1` | `timeline/*.go`、`api/task-timeline-v1-fixtures.json` |
| Signal `rin.signal/v1` | `signalbox/*.go`、`api/signal-openapi.json` |
| MCP Tool | `mcpbridge/server.go` |
Expand Down
2 changes: 1 addition & 1 deletion docs/host-integration-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ make build

`make verify` covers:

- Go formatting, vet, race, and all package tests;
- Go vet and all package tests under the race detector;
- Host, Control, and Agent OpenAPI consistency;
- Python, JavaScript, C#, Java, and Lua SDKs;
- Grid, Story, and Terminal V2 adapter flows;
Expand Down
Loading
Loading