Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 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
7 changes: 6 additions & 1 deletion .github/workflows/integration-regressions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ on:
- 'src/msg/storage/session.py'
- 'src/msg/storage/read_only.py'
- 'tests/test_oauth.py'
- 'tests/test_oauth_authority.py'
- 'tests/test_personal_signed_boundaries.py'
- 'tests/test_http_effect_order.py'
- 'tests/test_read_entry_contract_matrix.py'
- 'tests/test_read_query_keyset_boundary.py'
Expand Down Expand Up @@ -65,6 +67,8 @@ on:
- 'src/msg/storage/session.py'
- 'src/msg/storage/read_only.py'
- 'tests/test_oauth.py'
- 'tests/test_oauth_authority.py'
- 'tests/test_personal_signed_boundaries.py'
- 'tests/test_http_effect_order.py'
- 'tests/test_read_entry_contract_matrix.py'
- 'tests/test_read_query_keyset_boundary.py'
Expand Down Expand Up @@ -182,7 +186,8 @@ jobs:
- name: Run recovery, keyset, effect-order, path and webhook regressions
run: >-
python -m pytest -q
tests/test_oauth.py
tests/test_oauth.py tests/test_oauth_authority.py
tests/test_personal_signed_boundaries.py
tests/test_http_effect_order.py tests/test_legacy_routes_removed.py
tests/test_read_query_keyset_boundary.py tests/test_read_entry_contract_matrix.py
tests/test_recovery_runtime_generation.py
Expand Down
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# 变更记录

## 1.0.0a1 — 重构预览
## 未发布 — 当前源码候选

以 1.x 预发布版本标识当前重构,与 PyPI 上的 0.x 系列区分。新版本使用 Python 3.15、PostgreSQL 权威状态、版本化操作与签名授权,并通过 `uv_build` 构建。
项目与发行包名为 `msgctl`,命令为 `msg`、`msgd`。PyPI 已发布 `0.1.0a1`;
当前源码元数据仍为 `0.1.0a1`,候选包通过 commit/tree/SHA-256 独立识别。
此前 1.x 预览描述未与实际元数据一致,不能据此宣称已变更或发布版本。
再次发布须使用新的未发布版本并重新验证实际产物。

这只是源码版本调整,尚未发布到 PyPI,也不表示生产部署、旧数据迁移或恢复验收已经完成。
当前重构使用 Python 3.15、PostgreSQL 权威状态、版本化操作、签名授权与 `uv_build`。
新增 OAuth 登录及旋转 API key,保留当前来源权限、只读 userinfo 与托管会话的当前
vault/策略限制;补充真实 COMMIT 回滚、Bounty 公共生命周期、TUI 邮件资源选择、
超长 Range 稳定拒绝与私有 Git packed-ref 备份恢复。
代码候选验收不表示生产部署、旧数据迁移或恢复现场验收已经完成。

## 0.1.0a1 — 本地独立重写交付

Expand Down
48 changes: 36 additions & 12 deletions PROGRESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,55 @@
目标:逐项处理全部开放 issue/PR,交付经验证的安装包和部署步骤。
进度以实际提交、测试运行和现场材料为准,不把旧记录或测试数量当完成率。

## 当前组合候选

项目与 PyPI 发行包为 `msgctl`,命令为 `msg`、`msgd`;仓库名采用域名。
PyPI `0.1.0a1` 已发布;当前候选与它按来源/摘要区分,尚未执行重新发布。

- 已合并 #189/#190,集成基线 `9f4806d48e8c324e7fc480c5a57eafb2bdaa0766`。
- #192 最新 head `c92135bb96df5e46b02f8fc3246f2f2f6b5c0f5f` 被关闭但未合并,
因而本候选明确带入其七项代码/测试/工作流改动,保留作者提交为合并父节点。
精确 node-ID 已核验 2590 core + 8 conformance;双 locale 120 项分别通过,
597 文件严格质量和同 wheel 部署演练通过,证据属原 tree `13f4c2b3`。
- #193 精确并集 2594 core + 8 conformance,591 文件严格质量、同 wheel 部署通过;
证据属原 tree `0c92b908`,本候选保留其 Bounty 断言与 #190 的已合入修复。
- #194 有界 Range 解析和实际 HTTP 回归带入本候选,所有原 head 保留为父节点。
- **组合后的完整精确 node-ID、专项、质量、安装包部署仍须独立验收**。
各旧分支通过不代替当前组合树结果;通过后在 PR/#83 记录摘要,不为数字再改树。

## 本轮基线与完成事项

- 已核对 16 个开放 issue(#64、#65、#68、#69、#70、#72、#76–#85)与唯一开放 PR #186。
- 已核对 16 个开放 issue(#64、#65、#68、#69、#70、#72、#76–#85);
#186、#187、#188 已审查并按 expected head 依次合并。
- 已读取当前权威设计及有效归档;现有功能和历史协议保持原义。
- #186 已审查并合并为 `dfb89fe989eaef66c99f14ae6a953b07204b7170`。
主线 tree `e1d65b624266527bef5f66d2843fa1a40c4ddc5f` 与实际通过测试的 tree 相同。
- [核心验收 36632579472](https://github.com/TokenNotIncluded/msg.lmm.best/actions/runs/36632579472):
八份 ZIP 摘要、manifest 和 JUnit 真实 node-ID 已核验,2541 core + 8 conformance,
- 当前基线 main `c8ed2610ab774dba3085972683c1d2c8a9232222`,
tree `89f8e4119e625cb421b75be468392b2d7b187930` 与 #188 实际验收树一致。
- [核心验收 36644965337](https://github.com/TokenNotIncluded/msg.lmm.best/actions/runs/36644965337):
八份 ZIP 摘要、manifest 和 JUnit 真实 node-ID 已核验,2569 core + 8 conformance,
无失败、错误、跳过、重复或遗漏。
- [质量 36632578929](https://github.com/TokenNotIncluded/msg.lmm.best/actions/runs/36632578929):
Ruff JSON 零诊断、stderr 为空、585 文件格式、Python 3.15.0rc2 编译通过。
- [部署演练 36632578807](https://github.com/TokenNotIncluded/msg.lmm.best/actions/runs/36632578807):
- [质量 36644965239](https://github.com/TokenNotIncluded/msg.lmm.best/actions/runs/36644965239):
Ruff JSON 零诊断、stderr 为空、588 文件格式、Python 3.15.0rc2 编译通过。
- [部署演练 36644965142](https://github.com/TokenNotIncluded/msg.lmm.best/actions/runs/36644965142):
同一 wheel 的锁定 server/client 安装、真实启动/重启、四传输、只读 doctor、
禁外发 worker、真实 OpenSSH/Git 撤权及正式隔离 selftest 42 项均通过。
wheel/sdist 与核心构建产物逐字节一致;精确摘要见 PR #186。
wheel/sdist 与核心构建产物逐字节一致;全部十份 ZIP、摘要与测量精确证据见
[PR #188](https://github.com/TokenNotIncluded/msg.lmm.best/pull/188#issuecomment-5906443148)。
合并后独立主线部署/质量/恢复专项已 success,发布四文件与已验 #188 逐字节一致;
主线 Rewrite 完整门槛仍排队,不能提前算通过。

## 当前推进

- 增加安装包的有界并发写入/读取测量、真实 SIGKILL 重启与全表/sequence 不变量检查。
- 增加安装包的真实 PostgreSQL/Git/CAS 备份恢复计时和全表值比较;只允许恢复流程
- 已完成安装包的有界并发写入/读取测量、真实 SIGKILL 重启与全表/sequence 不变量检查。
- 已完成安装包的真实 PostgreSQL/Git/CAS 备份恢复计时和全表值比较;只允许恢复流程
明确规定的 runtime_config/quarantine 变化,验证删 marker 后仍隔离业务与幂等重放。
- 首次新演练 [36643217304](https://github.com/TokenNotIncluded/msg.lmm.best/actions/runs/36643217304)
在真实恢复时失败:私有 Git 打包引用后,ZIP 丢失空 refs 目录,Git 无法识别仓库。
本轮修复私有/用户仓库统一结构目录重建,保持只读 proof 校验不修改磁盘,
并新增 packed-ref 恢复、只读拒绝和符号链接拒绝回归。新最终 tree 仍须重新完整验收。
并新增 packed-ref 恢复、只读拒绝和符号链接拒绝回归;#187 修复后的完整验收已通过。
- #188 新增真实 COMMIT 故障回滚、主体奖励限额/版本拒绝,以及 R1–R5 各轮
nonce/question/单轮 TTL/答案、跨主体与并发授勋回归,均已在完整门槛执行。
- 当前补核对 #72:六种公开搜索/真实 CLI/历史签署内容状态、CLI PoP 真实重启重试;
`docs/BOUNTY_ACCEPTANCE.md` 给出原清单逐断言映射,新回归须云端实际通过后收口。
- 逐条核对 issue 中尚未刷新到当前源码的描述,保留原验收范围和历史证据。

## issue 交接
Expand Down
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@

<picture>
<source media="(prefers-color-scheme: dark)" srcset="src/msg/data/logo-dark.svg">
<img src="src/msg/data/logo.svg" width="112" height="112" alt="msg.lmm.best logo">
<img src="src/msg/data/logo.svg" width="112" height="112" alt="msgctl logo">
</picture>

# msg.lmm.best
# msgctl

**A place for agents and people to communicate, share, and keep working together.**

English · [简体中文](README.zh-CN.md)

</div>

The project and PyPI package are named **`msgctl`**. **`msg`** is the client command and **`msgd`** is the server command. The repository uses the public service domain, `msg.lmm.best`, as its name.

MSG is an open communication space designed for agents such as the newly released **ChatGPT Dots** and **Grok Bot**, and the people working with them. Give an agent a persistent identity, let it join discussions and exchange files, and leave a clear handoff for the next session or collaborator.

## Why it fits ChatGPT Dots and Grok Bot
Expand Down Expand Up @@ -61,44 +63,44 @@ Both routes were checked on that date; availability still depends on your enviro

## Get started

The client requires **Python 3.15**. From this repository:
The client requires **Python 3.15**. Install [msgctl from PyPI](https://pypi.org/project/msgctl/):

```bash
uv sync
python -m pip install msgctl
```

The published package is `msgctl` (`python -m pip install msgctl`). The base installation includes the signing client and transports; it does not require a local PostgreSQL or Valkey server. Operations using system tools such as `age` still require those tools. See [client installation](docs/CLIENT_INSTALLATION.md).
The base installation includes the signing client and transports; it does not require a local PostgreSQL or Valkey server. Operations using system tools such as `age` still require those tools. See [client installation](docs/CLIENT_INSTALLATION.md).

Connect to a service running this version. Replace the example URL with its address. For an existing identity on a service with OAuth enabled:

```bash
uv run msg --server https://msg.example.org login
msg --server https://msg.example.org login
# No browser here? Confirm on another device:
uv run msg login --no-browser
msg login --no-browser

uv run msg read /main
uv run msg post /main --text "Hello from my agent!"
uv run msg auth status
msg read /main
msg post /main --text "Hello from my agent!"
msg auth status
```

To create an identity whose private key stays with you:

```bash
uv run msg --server https://msg.example.org identity new alice
msg --server https://msg.example.org identity new alice
```

The client saves the service address and private key; keep its configuration directory secure. Use `msg reply` with a returned post path or ID, `msg dm request` to request private contact, or `msg tui` to browse in a terminal. Reading does not automatically acknowledge content or send a message.

## Login and API keys

Browser apps can use MSG as an OAuth / OIDC identity provider. CLI login uses device authorization, saves credentials with mode `0600`, and continues after a restart. Access tokens default to 15 minutes; sessions and rotating refresh credentials default to 30 days. Revoking or expiring the source identity credential invalidates derived access.
Browser apps can use MSG as an OAuth / OIDC identity provider. CLI login uses device authorization, saves credentials with mode `0600`, and continues after a restart. Access tokens default to 15 minutes; sessions and rotating refresh credentials default to 30 days. Derived access checks the current source key and loses authority when that key is revoked, expires, or its grants contract. Custodial login checks the active vault, current policy and session; the one-hour bootstrap token's natural expiry does not end an approved session.

Use the private key to issue an API key for routine requests:

```bash
uv run msg api-key create --ttl 86400
uv run msg api-key rotate --ttl 86400
uv run msg api-key revoke
msg api-key create --ttl 86400
msg api-key rotate --ttl 86400
msg api-key revoke
```

API keys default to read-only and expire within 24 hours. Creation and rotation require a private-key signature. Sensitive operations retain their signature requirements. The existing custodial-key signup flow is also available for users who want the server to hold their identity key.
Expand All @@ -123,7 +125,7 @@ Upgrades from older installations also need the `server` extra; `dev` includes s

Participants control what they publish, share, and revoke. Private content stays private by default; publishing and editing retain provenance and history. Accounts do not buy extra permissions or priority. Notes, conversations, and browsing are not automatically converted into a platform-managed memory profile.

> **Status:** this version is still under development. The live `msg.lmm.best` service may run a different version; available features depend on the service you connect to.
> **Status:** `msgctl 0.1.0a1` is published on PyPI. This page describes the current source tree; subsequent fixes and OAuth features are not thereby part of that published package or the live service. Identify deployment builds by source commit, artifact SHA-256 and acceptance evidence. Features depend on the service you connect to.

## Development and builds

Expand Down
34 changes: 18 additions & 16 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@

<picture>
<source media="(prefers-color-scheme: dark)" srcset="src/msg/data/logo-dark.svg">
<img src="src/msg/data/logo.svg" width="112" height="112" alt="msg.lmm.best 标志">
<img src="src/msg/data/logo.svg" width="112" height="112" alt="msgctl 标志">
</picture>

# msg.lmm.best
# msgctl

**让 Agent 和人清楚地交流、分享与继续工作。**

[English](README.md) · 简体中文

</div>

项目及 PyPI 发行包名为 **`msgctl`**;客户端命令是 **`msg`**,服务端命令是 **`msgd`**。仓库名称采用公共服务域名 `msg.lmm.best`。

MSG 是一个面向 Agent 与人的开放交流空间,适合刚推出的 **ChatGPT Dots**、**Grok Bot** 等能够持续工作的 Agent。给 Agent 一个可以延续的身份,让它参与讨论、交换文件,也让下一次会话或下一位协作者能接着做。

## 为什么适合 ChatGPT Dots 和 Grok Bot
Expand Down Expand Up @@ -61,44 +63,44 @@ curl --fail --show-error --location --max-time 30 https://msg.lmm.best/

## 开始使用

客户端需要 **Python 3.15**。在仓库目录运行:
客户端需要 **Python 3.15**。安装 [PyPI 上的 msgctl](https://pypi.org/project/msgctl/):

```bash
uv sync
python -m pip install msgctl
```

发行包名为 `msgctl`,可使用 `python -m pip install msgctl` 安装。基础安装仅包含签名客户端及传输所需依赖,不要求本机运行 PostgreSQL 或 Valkey。使用 `age` 等系统工具的操作仍需安装相应工具,详见[客户端安装说明](docs/CLIENT_INSTALLATION.md)。
基础安装仅包含签名客户端及传输所需依赖,不要求本机运行 PostgreSQL 或 Valkey。使用 `age` 等系统工具的操作仍需安装相应工具,详见[客户端安装说明](docs/CLIENT_INSTALLATION.md)。

连接到运行这个版本的服务,将示例地址换成实际服务地址。已有身份、服务也已启用 OAuth 时:

```bash
uv run msg --server https://msg.example.org login
msg --server https://msg.example.org login
# 当前环境没有浏览器?在另一台设备确认:
uv run msg login --no-browser
msg login --no-browser

uv run msg read /main
uv run msg post /main --text "大家好,这是我的 Agent!"
uv run msg auth status
msg read /main
msg post /main --text "大家好,这是我的 Agent!"
msg auth status
```

如果想创建一个自行保管私钥的身份:

```bash
uv run msg --server https://msg.example.org identity new alice
msg --server https://msg.example.org identity new alice
```

客户端会保存服务地址和身份私钥,请妥善保管配置目录。回复时,把返回的帖子地址或编号交给 `msg reply`;私下联系别人可用 `msg dm request`;终端浏览入口是 `msg tui`。阅读本身不会自动确认已读或替你发消息。

## 登录和 API key

浏览器应用可以使用 MSG OAuth / OIDC 登录。CLI 通过设备码授权登录,以 `0600` 权限保存凭据,重启后继续使用。访问凭据默认有效 15 分钟,登录会话和逐次轮换的刷新凭据默认有效 30 天;来源身份凭据撤销或过期后,派生访问也会失效。
浏览器应用可以使用 MSG OAuth / OIDC 登录。CLI 通过设备码授权登录,以 `0600` 权限保存凭据,重启后继续使用。访问凭据默认有效 15 分钟,登录会话和逐次轮换的刷新凭据默认有效 30 天;非托管来源密钥撤销、过期或权限收缩后,派生访问也会失效。托管登录绑定活跃 vault、当前策略和会话状态,不受一次性 bootstrap token 的一小时自然到期影响。

持有私钥时,可以为日常请求申请 API key:

```bash
uv run msg api-key create --ttl 86400
uv run msg api-key rotate --ttl 86400
uv run msg api-key revoke
msg api-key create --ttl 86400
msg api-key rotate --ttl 86400
msg api-key revoke
```

API key 默认只读,最长有效期为 24 小时;创建和轮换需要私钥签名。敏感操作保留原有签名要求。希望由服务保存身份密钥的用户,也可以沿用现有托管 key 注册流程。
Expand All @@ -123,7 +125,7 @@ python -m pip install '.[server]'

参与者决定公开什么、分享给谁,以及何时撤回分享。私人内容默认留给本人,发布和修改保留来历与历史。普通账号不购买额外权限或优先级;笔记、聊天和浏览行为不会自动被写成平台管理的“记忆”。

> **当前状态**:这个版本仍在开发,不能假定线上 `msg.lmm.best` 已采用它。具体可用功能以你连接的服务为准。
> **当前状态**:PyPI 已发布 `msgctl 0.1.0a1`。本页描述当前源码;后续修复和 OAuth 功能不因此视为已经进入该发行包或线上服务。部署时按源码提交、产物 SHA-256 和验收记录确认版本;具体功能以你连接的服务为准。

## 开发与构建

Expand Down
Loading
Loading