Skip to content

A local-first multi-agent app development platform, built on PenguinHarness

docs: 补上「提交同步」那块的两份变更记录

Adelieaa55e136cca0
diff --git a/changelog/unreleased/2026-10-15-requirements-box-commit-sync.md b/changelog/unreleased/2026-10-15-requirements-box-commit-sync.md
new file mode 100644
index 00000000..087074b6
--- /dev/null
+++ b/changelog/unreleased/2026-10-15-requirements-box-commit-sync.md
@@ -0,0 +1,36 @@
+# The requirements box shows what is not released or not on the live server yet
+
+- **Date:** 2026-10-15
+- **Type:** feat
+- **Scope:** `plugins`
+
+[中文版](2026-10-15-requirements-box-commit-sync.zh.md)
+
+The requirements box page carries a **commit sync** card. It answers, without leaving the page, the
+question that used to need a terminal: what has been committed but not released, and whether the
+server is running what has been released.
+
+It keeps three things apart, because one sentence for all three is what nobody can read:
+
+- **Unreleased** — the commits on the repo's `main` after the last release tag.
+- **The live server has not caught up** — commits that are already shipped but that the running
+ service has not picked up. Only commits that change what gets built are counted: a release-note or
+ ledger commit touches nothing but markdown, so counting it would have the page crying "1 behind"
+ after every release until nobody reads it any more.
+- **Installed but not restarted** — the version on disk is newer than the version running, which is
+ its own state and used to be invisible: the update is installed, the process still holds the old
+ code, and the page said nothing about it.
+
+Which version the live server runs is asked of the server itself (`/api/version`), never read off
+disk — reading the disk is exactly what hides the installed-but-not-restarted case. That endpoint
+wants the machine's own token; the file is read inside the box's process and never reaches the
+browser. Every source comes from `box.config.json` (`repoDir`, `serverUrl`, `serverTokenFile`,
+`installDir`), and `install.mjs` works them out — the repo defaults to the workspace the patrol edits,
+and the server URL is read from the port in the data root's `server.lock`. What cannot be worked out
+is reported as "not configured" rather than guessed; an unconfigured repo hides the card entirely,
+while a configured one that cannot be read says why.
+
+## API
+
+`GET /api/requirements/sync` returns the whole picture (keyed like every other endpoint, cached for
+30 seconds, `?fresh=1` to skip the cache).
diff --git a/changelog/unreleased/2026-10-15-requirements-box-commit-sync.zh.md b/changelog/unreleased/2026-10-15-requirements-box-commit-sync.zh.md
new file mode 100644
index 00000000..f6be9184
--- /dev/null
+++ b/changelog/unreleased/2026-10-15-requirements-box-commit-sync.zh.md
@@ -0,0 +1,29 @@
+# 需求箱页面多一块「提交同步」:哪些提交没发版、现网跟没跟上
+
+- **Date:** 2026-10-15
+- **Type:** feat
+- **Scope:** `plugins`
+
+[English](2026-10-15-requirements-box-commit-sync.md)
+
+需求箱的页面上多了一块**提交同步**。它回答的是以前要开终端才知道的事:提交了但还没发出去的有
+哪些,以及现网到底在跑哪一版。
+
+三件事分开写,因为合成一句话就没人看得懂:
+
+- **未发版** —— 仓库 `main` 上最后一个发布标签之后的提交。
+- **现网没跟上** —— 已经发出去、而正在跑的那个服务还没换上的提交。**只算会进构建的提交**:
+ 发布正文、记账这类只动 markdown 的提交从不进产物,把它们算进去,每次发完版页面都会喊「现网
+ 落后 1 条」,喊多了就没人看了。
+- **装了没重启** —— 磁盘上的版本比正在跑的那个进程新。这是单独一种状态,以前页面完全看不出来:
+ 更新装好了,进程还攥着旧代码。
+
+现网在跑哪个版本是**问它自己**(`/api/version`),不是读磁盘上那份——读磁盘正好把这个区别盖掉。
+那个接口要本机口令,口令只在本进程里读,绝不下发给浏览器。出处全在 `box.config.json`
+(`repoDir`、`serverUrl`、`serverTokenFile`、`installDir`),`install.mjs` 会自己推:仓库默认就是
+巡台改代码的那个工作区,现网地址读数据根 `server.lock` 里的端口。推不出来的如实写「没配」,不猜;
+没配仓库整块不显示,配了却读不动则把原因写在明面上。
+
+## 接口
+
+`GET /api/requirements/sync` 一次给全(和其它接口一样要口令,缓存 30 秒,`?fresh=1` 跳过缓存)。