Skip to content

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

refactor(cli,server,web,docker): 边界面变量的写侧改用 Adelie 的名字(非桌面壳的一批)

lmliheng079cf1b4528b
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 59efd43d..42f17375 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -76,13 +76,13 @@ data root admits one server at a time (`<root>/server.lock`) and the dev CLI's
shared root that Agent's `dev:server` would refuse to start, blocked by the harness's
own lock (the same coexistence that already gives it port 7369, see
`packages/core/src/internal/ports.ts`). To aim a dev CLI command at the `pnpm dev`
-dataset anyway, say so per command — `PENGUIN_HOME=~/.penguin/dev-data pnpm penguin ...`,
+dataset anyway, say so per command — `ADELIE_HOME=~/.penguin/dev-data pnpm penguin ...`,
or `--root` where the subcommand takes it. Need a different root?
-Pass `PENGUIN_HOME` inline, for the single
-command that needs it (`PENGUIN_HOME=~/.penguin/dev-data-<topic> pnpm dev`) — never export
+Pass `ADELIE_HOME` inline, for the single
+command that needs it (`ADELIE_HOME=~/.penguin/dev-data-<topic> pnpm dev`) — never export
it into your shell: those defaults apply only when the variable is unset or empty
(`scripts/run-with-env.mjs`), so an exported value silently wins over all of them, and an
-exported `PENGUIN_HOME=~/.penguin/data` puts `pnpm dev:server` on the release/CLI root
+exported `ADELIE_HOME=~/.penguin/data` puts `pnpm dev:server` on the release/CLI root
where a running desktop app already holds the lock. The desktop dev shell isolates one
step further: an unpackaged run takes a dev-suffixed app identity (`Adelie-Dev`)
with its own userData directory, single-instance lock, and sticky port, and defaults to
@@ -108,7 +108,8 @@ instance never touches the release server someone is using there
Two one-time moves came with that split. A bare `pnpm --dir packages/desktop start` used
to run on `~/.penguin/data` (the release/CLI root) and now runs on `~/.penguin/dev-data`,
so sessions made that way are no longer in the window — run it with
-`PENGUIN_HOME=~/.penguin/data` to work against the release root on purpose. And the dev
+`PENGUIN_HOME=~/.penguin/data` (the shell reads the pre-rename spelling; the dev entries
+above write Adelie's `ADELIE_HOME`) to work against the release root on purpose. And the dev
shell's userData directory moved with its name, taking the Chromium profile along, so the
window's origin-scoped preferences (theme, language, layout) and its remembered port
start fresh once. Note the identity is one fixed name, not one per checkout: two working
@@ -215,7 +216,7 @@ pnpm test:e2e # core live-model e2e, need
Open an issue from the [issue forms](https://github.com/Prism-Shadow/penguin-harness/issues/new/choose).
A bug report is worth far more with the version (`penguin version`), how Adelie
was installed, the OS, and whether the problem survives a fresh data root
-(`PENGUIN_HOME=/tmp/penguin-check penguin ...`) — that last one separates a code defect
+(`ADELIE_HOME=/tmp/penguin-check penguin ...`) — that last one separates a code defect
from a state left behind by an earlier version. Never paste an API key, a bot token,
`system_config.yaml`, or a `.env` into an issue: the data root holds provider credentials
in plain text, and an issue is public and permanent.
diff --git a/.github/CONTRIBUTING.zh.md b/.github/CONTRIBUTING.zh.md
index d38892fd..6215a818 100644
--- a/.github/CONTRIBUTING.zh.md
+++ b/.github/CONTRIBUTING.zh.md
@@ -57,11 +57,11 @@ web/server 消费的是快照副本,只有当该包的 `build` 脚本经由 pn
随后会让 Agent 去执行 `pnpm dev` 的 harness——共用根目录时,那个 Agent 的 `dev:server` 会被 harness
自己的锁挡住而拒绝启动(正是这种共存关系也已经为它分配了 7369 端口,见
`packages/core/src/internal/ports.ts`)。若仍要让某条开发 CLI 命令对准 `pnpm dev` 的数据集,就为该条
-命令单独声明——`PENGUIN_HOME=~/.penguin/dev-data pnpm penguin ...`,或在支持的子命令上使用
-`--root`。需要另一个根目录?只为需要它的那一条命令内联传入 `PENGUIN_HOME`
-(`PENGUIN_HOME=~/.penguin/dev-data-<topic> pnpm dev`)——绝不要把它 export 进 shell:上述默认值仅在
+命令单独声明——`ADELIE_HOME=~/.penguin/dev-data pnpm penguin ...`,或在支持的子命令上使用
+`--root`。需要另一个根目录?只为需要它的那一条命令内联传入 `ADELIE_HOME`
+(`ADELIE_HOME=~/.penguin/dev-data-<topic> pnpm dev`)——绝不要把它 export 进 shell:上述默认值仅在
该变量未设置或为空时才生效(`scripts/run-with-env.mjs`),因此一个已导出的值会静默盖过全部默认值;
-而导出 `PENGUIN_HOME=~/.penguin/data` 会把 `pnpm dev:server` 放到发行版/CLI 的根目录上,那里已经有
+而导出 `ADELIE_HOME=~/.penguin/data` 会把 `pnpm dev:server` 放到发行版/CLI 的根目录上,那里已经有
一个运行中的桌面应用持有锁。桌面开发外壳还多隔离一层:未打包的运行会取一个带 dev 后缀的应用标识
(`Adelie-Dev`),拥有自己的 userData 目录、单实例锁与固定端口,并且即使在没有该环境变量的
情况下启动(`pnpm --dir packages/desktop start`)也默认使用 `~/.penguin/dev-data`——因此它可以与已
@@ -70,7 +70,8 @@ web/server 消费的是快照副本,只有当该包的 `build` 脚本经由 pn
这次拆分带来了两处一次性变化。此前直接执行 `pnpm --dir packages/desktop start` 跑在
`~/.penguin/data`(发行版/CLI 根目录)上,现在跑在 `~/.penguin/dev-data`,因此那样创建的会话不再出现
-在窗口里——若要刻意对着发行版根目录工作,用 `PENGUIN_HOME=~/.penguin/data` 启动。另外开发外壳的
+在窗口里——若要刻意对着发行版根目录工作,用 `PENGUIN_HOME=~/.penguin/data` 启动(外壳读的是改名前的
+拼写;上面那些开发入口写的是 Adelie 的 `ADELIE_HOME`)。另外开发外壳的
userData 目录随其名称一并搬家,Chromium 配置文件也跟着走,因此窗口按 origin 存储的偏好(主题、语言、
布局)与记住的端口会重置一次。注意该标识是一个固定名称,而非每个工作副本一个:两份工作副本同时运行
桌面外壳仍会共用它,第二次启动会聚焦到第一个窗口而不是自己开一个——换一个 `PENGUIN_HOME` 也改变不了
@@ -153,7 +154,7 @@ pnpm test:e2e # core 的真实模型 e2e
从 [issue 表单](https://github.com/Prism-Shadow/penguin-harness/issues/new/choose) 提交。一份缺陷报告
附上版本(`penguin version`)、Adelie 的安装方式、操作系统,以及问题是否在全新的数据根目录上
-依然出现(`PENGUIN_HOME=/tmp/penguin-check penguin ...`),价值会高得多——最后这一条能把代码缺陷与
+依然出现(`ADELIE_HOME=/tmp/penguin-check penguin ...`),价值会高得多——最后这一条能把代码缺陷与
旧版本遗留的状态区分开。永远不要把 API Key、机器人 Token、`system_config.yaml` 或 `.env` 贴进
issue:数据根目录以明文保存 Provider 凭据,而 issue 是公开且永久的。
diff --git a/Dockerfile b/Dockerfile
index 38f007c0..0772a007 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -219,12 +219,12 @@ LABEL org.opencontainers.image.title="Adelie" \
# CLI entry — it would then offer in-container self-update, which installs into a filesystem
# the next `docker pull` throws away. Through the symlink argv[1] is /usr/local/bin/penguin,
# extensionless, so the entry stays unset and the update endpoint answers "unsupported".
-# PENGUIN_WEB_DIST below is the other half of what that launcher would have done.
+# ADELIE_WEB_DIST below is the other half of what that launcher would have done.
COPY --from=native /opt/penguin /opt/penguin
RUN set -eux; \
chmod 0755 /opt/penguin/lib/dist/penguin.js; \
ln -s /opt/penguin/lib/dist/penguin.js /usr/local/bin/penguin; \
- PENGUIN_HOME=/tmp/penguin-smoke penguin --version; \
+ ADELIE_HOME=/tmp/penguin-smoke penguin --version; \
rm -rf /tmp/penguin-smoke
# ubuntu:24.04 ships a stock `ubuntu` account already holding uid/gid 1000 — the id a host
@@ -239,8 +239,8 @@ RUN set -eux; \
# replaces the process's ids without rewriting its environment: without this the server
# would run as `penguin` while still pointed at root's home.
ENV HOME=/home/penguin \
- PENGUIN_HOME=/data \
- PENGUIN_WEB_DIST=/opt/penguin/web \
+ ADELIE_HOME=/data \
+ ADELIE_WEB_DIST=/opt/penguin/web \
HOST=0.0.0.0 \
PORT=7364
diff --git a/FORK-PROGRESS.md b/FORK-PROGRESS.md
index 9b54e354..454984ee 100644
--- a/FORK-PROGRESS.md
+++ b/FORK-PROGRESS.md
@@ -96,6 +96,15 @@
那一份;读侧本来就两个都认(核心 `state/boundary-env.ts`,新名优先),所以两个都写就等于
对两侧都成立。另一条路(探测远端版本)要花一次握手 —— 这个文件从头到尾都在数握手次数 —— 而且
store 里同时可能存在改名两侧的版本,探出来也不一定对。细节与实测见「已完成的轮次」最后一行。
+ - **写侧又补一批(2026-10-06,第九轮)**:第八轮说的「`machines/commands.ts` 是写侧最后一个
+ 不在桌面壳一侧的写点」**说早了** —— 仓库里还有一批非桌面壳的写点写着旧名(读侧两个都认,所以
+ 一直没暴露):两个 `penguin` 脚本(根 `package.json` 与 `packages/cli/package.json`)、
+ `packages/server/package.json` 的 `dev` 脚本、`packages/web/e2e/run.sh` 起服务那一行、
+ `Dockerfile` 的 `ENV`、以及 `install.ps1` 在缺 `bin\penguin.cmd` 时**生成**的那个 Windows
+ 启动器垫片(它和第七轮改过的 `scripts/launchers/penguin.cmd` 是同一件东西,改完两者拼写一致)。
+ 变量名全都改用 Adelie 的,**取值一个没动**(`~/.penguin/dev-data`、`~/.penguin/dev-data-cli`
+ 这些**路径**仍留旧拼写,理由见 `packages/core/src/internal/ports.ts`:那是与桌面壳耦合的那步)。
+ 细节与实测见「第九轮」一节。
- **还差什么(做这一条时要一起收的尾)**:
1. **写侧剩下的全在桌面壳一侧**:`packages/desktop/src/{server-process,launcher,web-dist}.ts`
仍导出 / 传 `PENGUIN_PROFILE` / `PENGUIN_CLI_ENTRY` / `PENGUIN_WEB_DIST` / `PENGUIN_DESKTOP_TOKEN` /
@@ -708,6 +717,7 @@ v0.2.2」——它只加台账里 v0.2.2 那一节与两行表格,**跟本轮
| 2026-10-05 | 2.2b | 控制面环境变量改名:25 个名字 / 77 个文件 / 388 处 `PENGUIN_*` → `ADELIE_*`(会话、API、语言、终端、审批与测试脚手架那批;注释、zh/en 文案、插件技能契约、`docker/compose.yaml` 一起改);`core` 的剥离规则注释补写「为什么仍留两个前缀」 | 六包 typecheck 过;`pnpm lint` 0 警告;`pnpm format:check` 干净(两处超宽行交给 prettier);core **1350 / 5 跳过**、ui **1000**、web **2887 / 2 跳过**、cli **505**、server **2563 / 2 跳过**(首跑 1 条红是 `dist/install.ps1` 副本过期,重建 server 后转绿)—— 0 失败;运行时实测:`ADELIE_LANG=zh` 出中文帮助、旧名 `PENGUIN_LANG=zh` 不再生效、`ADELIE_SEED_ADMIN_PASSWORD` 起服务不再打印 claim 链接;浏览器(7431,数据根 `/root/adelie-fork-data`)标题 `Sign in · Adelie`、console 唯一 error 是登录前 `/api/me` 401;推送后 CI run `37302398244` **22 个 job 全绿**(含本机按纪律没跑的 desktop 一族,等于替桌面壳那半边也验了一遍) | 见本行提交 |
| 2026-10-06 | 2.2c(前半) | 边界面部署变量的**读侧**同时认 Adelie 的名字与旧名:core 新增 `state/boundary-env.ts`(`ADELIE_*` ← 旧 `PENGUIN_*` 的表 + 读取函数,新名优先);接上 server 的 `config.ts`(WEB_DIST / WEB_DB / PORT_FILE / DESKTOP_TOKEN / CLI_ENTRY)、version 路由的 CLI_ENTRY、`machines/layout.ts` 的 PROFILE、CLI 三个命令的 WEB_DB、core 的 BUNDLED_SHELL,server README 的环境表与各处注释跟上。**写侧一个没改**(桌面壳按纪律没碰),所以 2.2c 仍未勾掉,「还差什么」写在条目里 | 六个包 typecheck 过;`pnpm lint` 0 警告、`pnpm format:check` 干净;core 1359 / 5 跳过 · server 2594 / 2 跳过 · cli 505 · ui 1000 · web 2877 / 2 跳过,**0 失败**;真起服务三次(数据根 `/root/adelie-fork-data/alias-*`,端口 7451 只用新名 / 7452 只用旧名 / 7453 两名并存):三次都 302 → 登录页 `<title>Adelie</title>`,日志里的 SQLite 与 Web dist 都对,端口文件按各自的名字落盘;并存那次落的是新名的 `new.db` / `new.port`,旧名的 `old.db` / `old.port` 与 `PENGUIN_HOME` 指的旧根**一个都没建** | `83acbdf0` |
| 2026-10-06 | 2.2c(写侧的远端命令) | `machines/commands.ts` 的 `remotePenguin()` 改成**两个名字都写**:远端命令现在同时给出 `ADELIE_HOME` / `PENGUIN_HOME` 与 `ADELIE_PROFILE` / `PENGUIN_PROFILE`(Adelie 的名字在前、两个取值相同),注释里写明为什么不是「探测远端版本」(这条命令落地的 CLI 来自那台机器的 hmr store,可能是更早的发行推上去的、只认旧名;探测要花一次握手且探不准)。顺带把 `machines/layout.ts` 的数据根注释与 `machines.test.ts` 的注解跟上 | 六包 typecheck 过;`pnpm lint` 0 警告、`pnpm format:check` 干净;core **1359** / 5 跳过 · server **2601** / 2 跳过(+1 新用例,钉住两个名字与先后)· cli **505** · ui **1003** · web **2877** / 2 跳过,**0 失败**;把 `remotePenguin()` **真生成的那条命令**(不是复述)拿 `sh` 跑了一遍:假 HOME 下桩「node」换成 core 的 `resolveRoot()` / `boundaryEnv()`,四个变量都在且取值一致,解析出的根与 profile 都是这一侧的 dev(`reader-root=$HOME/.penguin-dev/data`、`reader-profile=dev`) | `16368121` |
+| 2026-10-06 | 2.2c(写侧·非桌面壳的一批) | 第八轮漏掉的那批非桌面壳写点改用 Adelie 的名字:两个 `penguin` 脚本、`server` 的 `dev` 脚本、`packages/web/e2e/run.sh` 起服务那行、`Dockerfile` 的 `ENV`、`install.ps1` 生成的 Windows 启动器垫片(与 `scripts/launchers/penguin.cmd` 对齐);**取值一个没动**,测试守卫与 CONTRIBUTING / 注释跟上 | 六包 typecheck 过 · `pnpm lint` 0 · `pnpm format:check` 干净;cli **506** · ui **1003** · server **2606** / 2 跳过 · web **2888** / 2 跳过(core 那条红来自另一条线正在改的 `README.md` 分类表,非本轮);脚本行默认值经 `run-with-env.mjs` + 桩解析,新旧拼写逐字相同;`pnpm penguin version` 真跑;按 `web/e2e/run.sh` 那一行的变量名真起一次服务(日志自报数据根 / SQLite / 前端目录都对、标题 Adelie);整条 e2e 42/69 —— 失败是**旧前端产物**造成的选择器错位,非本轮;`sh scripts/test-installer.sh` 通过 | 见本行提交 |
> **2026-10-06 与另一条线的交汇(第六轮)**:本轮开工时 `git status --short` 是干净的;做完检查那一
> 步时工作区里多出**另一条线**的改动 —— 47 个 `package.json` 的 `version` 0.3.0 → 0.3.1、
@@ -715,6 +725,14 @@ v0.2.2」——它只加台账里 v0.2.2 那一节与两行表格,**跟本轮
> 准备)。本轮**一个都没碰**,`git add` 只列了自己的 22 个文件;那批改动仍在工作区里等它那条线自己
> 提交。
+> **2026-10-06 与另一条线的交汇(第九轮)**:开工时 `git status --short` 干净、`main` = `2a8f56e7`
+> (上一轮之后,另一条线提交了「插件市场给每个自带插件包一条条目」与「定时任务页加跨项目只读总览」
+> 两条,都没动这份台账)。本轮进行中,那条线又在同一棵树里改了 `README.md` / `README.zh.md`(加分类
+> 表与截图)、`packages/desktop/electron-builder.yml`,并留下未跟踪的 `assets/readme/*`、
+> `packages/desktop/{build,scripts,test}` 与 `scripts/capture-readme-shots.mjs` —— 本轮**一个都没
+> 碰**,`git add` 只列自己的 11 个文件。core 那条红正是那份**未提交**的 README 分类表引起的(句式
+> 标题 vs core 的 Title Case 组标题),由它那条线自己收尾。
+
## 服务迁移:PenguinHarness → Adelie(2026-10-05,用户定的方案 A)
用户要求「把 penguin harness 的 service 迁到 Adelie」,在端口两案里选了 **A:Adelie 接管 7364** ——
@@ -1533,3 +1551,91 @@ web 2877 / 2 跳过,**0 失败**。另外把 `remotePenguin()` **真生成的
**这一条还没法勾掉**:2.2c 的写侧剩下 `packages/desktop/src/{server-process,launcher,web-dist}.ts`
与桌面壳自己的开关,按纪律(依赖没装、3.5 才决定取哪个桌面壳)这一轮没碰;`machines/commands.ts`
是写侧最后一个不在桌面壳一侧的写点,到此为止。
+
+## 第九轮:写侧剩下的非桌面壳位置(2026-10-06,条目 2.2c 的写侧收尾·二)
+
+第八轮把「写侧最后一个不在桌面壳一侧的写点」记在 `machines/commands.ts` 上,这一轮核对时发现
+**那句话不成立**:仓库里还有一批非桌面壳的位置在写旧名。它们一直没暴露,因为读侧两个都认
+(`ADELIE_*` 优先、旧 `PENGUIN_*` 兜底),跑起来一切正常 —— 也正因为如此,只有逐个 grep 才看得见。
+
+### 改了哪 6 处(都只换变量名,取值一个没动)
+
+| 位置 | 原来 | 现在 | 谁读它 |
+| --- | --- | --- | --- |
+| 根 `package.json` 的 `penguin` 脚本 | `PENGUIN_HOME=~/.penguin/dev-data-cli` + `PENGUIN_PROFILE=dev` | `ADELIE_HOME=…` + `ADELIE_PROFILE=dev` | core 的 `resolveRoot()` / `boundaryEnv()` |
+| `packages/cli/package.json` 的 `penguin` 脚本 | 同上 | 同上 | 同上(这两条必须一致,测试钉着) |
+| `packages/server/package.json` 的 `dev` 脚本 | `PENGUIN_HOME=~/.penguin/dev-data` + `PENGUIN_PROFILE=dev` | `ADELIE_HOME=…` + `ADELIE_PROFILE=dev` | 同上 |
+| `packages/web/e2e/run.sh` 起服务那一行 | `PENGUIN_HOME` / `PENGUIN_WEB_DB` / `PENGUIN_WEB_DIST` | 三个都换 `ADELIE_*` | server 的 `config.ts`(边界变量) |
+| `Dockerfile` 的 `ENV` 与冒烟那一行 | `PENGUIN_HOME` / `PENGUIN_WEB_DIST` | `ADELIE_HOME` / `ADELIE_WEB_DIST` | server / CLI |
+| `install.ps1` 在缺垫片时**生成**的 `bin\penguin.cmd` | 只设 `PENGUIN_WEB_DIST` / `PENGUIN_BUNDLED_SHELL` | 设 `ADELIE_*`,旧名 `PENGUIN_WEB_DIST` 仍照办 | 装出来的那份 CLI |
+
+`install.ps1` 那处值得多说一句:它和第七轮改过的 `scripts/launchers/penguin.cmd` 是**同一件东西**
+(payload 里带的垫片,只在缺文件时重新生成),第七轮只改了前者,于是两者拼写分叉了;这一轮把生成的
+那份也改成与 shipped 的逐行同一规则(新名在前、旧名兜底),不再有「装出来的启动器与包里的启动器
+行为不同」这种状态。
+
+### 没有动的(各有理由,不是漏)
+
+- 根 `package.json` 的 `desktop` 脚本仍写 `PENGUIN_HOME=~/.penguin/dev-data`:它的读者是**桌面壳**
+ (`app-identity.ts`、`main.ts` 直接读 `process.env.PENGUIN_HOME`),桌面壳的读侧**不在**
+ `core/state/boundary-env.ts` 里 —— 改成新名会让开发壳落到默认根上去。这是 2.2c 桌面壳那一半的
+ 事,本机按纪律没碰。
+- 那两个**路径**(`~/.penguin/dev-data`、`~/.penguin/dev-data-cli`):变量名换了、值没换,因为
+ `dev-data` 与桌面壳共用,两者必须一起搬(`packages/core/src/internal/ports.ts` 里写着)。
+- `PENGUIN_INSTALL_DIR` / `PENGUIN_VERSION` / `PENGUIN_ARCHIVE` / `PENGUIN_DOWNLOAD_*` /
+ `__PENGUIN_*__`:安装器与发布协议,属 4.x。
+- `packages/docs/**`、`.agents/**`、`changelog/**`、`RELEASE-v0.2.0.md`:按 2.1c / 2.2c 的口径有意
+ 留着(内部参考 / 上游的开发技能 / 历史)。`packages/docs/content/configuration.md` 那张环境变量表
+ 因此仍写旧名,跟「数据根默认值」一起等发布期那一轮再动。
+
+### 顺带改的四处「说明」
+
+- `packages/cli/test/dev-entry-isolation.test.ts`:那条漂移守卫原本按 `PENGUIN_HOME` 取两个 dev
+ 入口的数据根,改成 `ADELIE_HOME`;**新增一条用例**把「两个 dev 入口写的是 Adelie 的拼写」钉死
+ (旧名必须不出现),桌面壳那条仍按 `PENGUIN_HOME` 断言,文件头写明为什么它是例外。
+- `scripts/run-with-env.mjs`:三处注释例子里的 `PENGUIN_HOME=/somewhere pnpm dev` → `ADELIE_HOME=…`。
+- `.github/CONTRIBUTING{,.zh}.md`:教开发者的那几处(`pnpm penguin` / `pnpm dev` / 报缺陷时的空根
+ 检查)改用 `ADELIE_HOME`;**涉及桌面壳的两处保留 `PENGUIN_HOME`**,并各补一句「外壳读的是改名前的
+ 拼写」,免得下一个人顺手「修正」错地方。
+- `packages/core/src/internal/ports.ts`:分配表补一句 —— 变的是**变量名**,那几条 `~/.penguin/*`
+ 是**路径**,仍等与桌面壳一起搬。
+
+### 验证(都不是推测)
+
+- 门禁:六个包 typecheck 过(core / server / web / ui / cli / hmr);`pnpm lint` 0 警告;
+ `pnpm format:check` 干净。
+- 测试:cli **506**(505 + 新增那条守卫)· ui **1003** · server **2606 / 2 跳过**(首跑 1 条红是
+ `dist/install.ps1` 副本过期 —— 老坑,重建 core + server 后转绿)· web **2888 / 2 跳过**。
+ core 是 **1358 通过 / 1 失败**,那条红**不是本轮的**:另一条线正在改 `README.md`(工作区里未提交
+ 地加了一张 Category 表,写的是 `AI app development` 这种句式,而 core 的组标题是 `AI App
+ Development`),`plugins.test.ts` 的 README 表守卫因此报不一致 —— 本轮一个字节都没碰那两个文件。
+- **默认值真解析一遍**:把脚本行里的 `VAR=value` 原样抽出来交给 `run-with-env.mjs`,命令换成一个打印
+ `resolveRoot()` / `boundaryEnv("profile")` 的桩,三个入口各跑两次(新拼写 / 旧拼写):新拼写下
+ `dev:server` → `/root/.penguin/dev-data`、两个 `penguin` → `/root/.penguin/dev-data-cli`,profile
+ 都是 `dev`,**与旧拼写逐字相同**。
+- **真跑开发入口**:`pnpm penguin version`(用它自己的默认值)→ `v0.3.2-8-g2a8f56e7-dirty`,
+ 且 `~/.penguin/dev-data-cli` 没有被建出来(`version` 不碰数据根)。
+- **按那一行的变量名真起一次服务**:从 `packages/web/e2e/run.sh` 里**取出**它写的那几个变量名
+ (`ADELIE_HOME` / `ADELIE_WEB_DB` / `ADELIE_WEB_DIST` / `ADELIE_SEED_ADMIN_PASSWORD`),用它们起
+ `packages/server/dist/index.js`(数据根 `/root/adelie-fork-data/r9-namecheck`,端口 7477/7478):
+ 服务端自报 `Data root:` / `SQLite:` / `Web dist:` 三行都对,根目录里落下 `web.db` / `api-token` /
+ `server.lock`,`GET /` 302 → 200 且标题 `<title>Adelie</title>`、`/api/me` 401(未登录,预期);
+ 两个临时端口用完都已释放。
+- **真跑端到端(这条不是绿的,照实说)**:`SKIP_BUILD=1 bash packages/web/e2e/run.sh` 跑了 14.2 分钟,
+ **42 passed / 27 failed**。失败全是 UI 选择器级的(`getByPlaceholder(/输入消息/) resolved to 2
+ elements`、`toBeVisible` 找不到元素),**与本轮改的那行环境变量无关**:`packages/web/dist` 是今天
+ 05:00 的产物,而 13:35(`faeec636`)与 14:08(`2a8f56e7`)两条提交都改了 `packages/web/src`
+ —— 拿旧前端产物跑 Playwright 必然错位。服务端一侧从头到尾是好的:服务在 8930 起得来、mock 在 8931,
+ 全程几千条 200(日志在会话 scratchpad 的 `e2e.log`)。**没顺手重建 web 产物再跑一遍**:那既不是本条
+ 改动(改的只是变量名,解析结果逐字未变),又要在这棵正被另一条线使用的树里动 `packages/web/dist`,
+ 而磁盘只剩 ~0.9G。
+- `sh scripts/test-installer.sh` 通过(含它对两个启动器脚本的守卫)。
+
+### 还差什么(2.2c 仍未勾掉)
+
+- 写侧的桌面壳一侧:`packages/desktop/src/{server-process,launcher,web-dist}.ts` 与其自己的开关
+ (`DESKTOP_SMOKE*` / `NO_LOGIN_SHELL_ENV` / `UPDATE_FEED_URL` / `BB_SMOKE_BUNDLE`),按纪律本机没碰,
+ 等 3.5 决定桌面壳取哪个时一起改。**注意**:在这一步之前,`desktop` 脚本与桌面壳的读侧必须继续写
+ / 读旧名,不然开发壳的根会落到默认值。
+- 既有部署 `adelie-app.service`(3004,已 stop + disable)仍设旧名:读侧两条都认,改它属发布动作。
+
diff --git a/install.ps1 b/install.ps1
index f537dbbc..2d863d05 100644
--- a/install.ps1
+++ b/install.ps1
@@ -350,7 +350,10 @@ try {
}
}
- # --- Launcher shim: shipped in the payload; (re)generated only when missing. There is
+ # --- Launcher shim: shipped in the payload; (re)generated only when missing. The two
+ # variables it fills in use Adelie's spelling, with the pre-rename PENGUIN_WEB_DIST
+ # still honored, exactly like scripts/launchers/penguin.cmd — a shim regenerated here
+ # must not behave differently from the one the payload ships. There is
# deliberately no penguin.ps1 launcher — PowerShell would prefer it over penguin.cmd on
# PATH, and client Windows defaults to the Restricted execution policy, so a .ps1
# launcher makes the plain `penguin` command fail with "running scripts is disabled".
@@ -363,8 +366,9 @@ try {
'@echo off'
'setlocal'
'set "DIR=%~dp0.."'
- 'if not defined PENGUIN_WEB_DIST set "PENGUIN_WEB_DIST=%DIR%\web"'
- 'if exist "%DIR%\git\usr\bin\sh.exe" set "PENGUIN_BUNDLED_SHELL=%DIR%\git\usr\bin\sh.exe"'
+ 'if not defined ADELIE_WEB_DIST if defined PENGUIN_WEB_DIST set "ADELIE_WEB_DIST=%PENGUIN_WEB_DIST%"'
+ 'if not defined ADELIE_WEB_DIST set "ADELIE_WEB_DIST=%DIR%\web"'
+ 'if exist "%DIR%\git\usr\bin\sh.exe" set "ADELIE_BUNDLED_SHELL=%DIR%\git\usr\bin\sh.exe"'
'if exist "%DIR%\node\node.exe" ('
' "%DIR%\node\node.exe" "%DIR%\lib\dist\penguin.js" %*'
') else ('
diff --git a/package.json b/package.json
index 3de8190e..8b63b731 100644
--- a/package.json
+++ b/package.json
@@ -18,7 +18,7 @@
"test:e2e": "pnpm --filter @lmliheng/penguin-core test:e2e",
"build": "pnpm -r build && pnpm link:cli",
"link:cli": "pnpm --dir packages/cli link --global || echo '[link:cli] pnpm global directory not configured; skipping the global penguin link (run pnpm setup once first)'",
- "penguin": "node scripts/run-with-env.mjs PENGUIN_HOME=~/.penguin/dev-data-cli PENGUIN_PROFILE=dev PORT=7369 -- tsx packages/cli/src/penguin.ts",
+ "penguin": "node scripts/run-with-env.mjs ADELIE_HOME=~/.penguin/dev-data-cli ADELIE_PROFILE=dev PORT=7369 -- tsx packages/cli/src/penguin.ts",
"dev": "concurrently -n server,web -c cyan,magenta \"pnpm dev:server\" \"pnpm dev:web\"",
"dev:server": "pnpm --filter @lmliheng/penguin-server dev",
"dev:web": "node scripts/dev-prebuild.mjs && pnpm --filter @lmliheng/penguin-web dev",
diff --git a/packages/cli/package.json b/packages/cli/package.json
index 7a330d6f..44ebfccf 100644
--- a/packages/cli/package.json
+++ b/packages/cli/package.json
@@ -20,7 +20,7 @@
"typecheck": "tsc --noEmit -p tsconfig.json",
"test": "vitest run --passWithNoTests",
"build": "tsup",
- "penguin": "node ../../scripts/run-with-env.mjs PENGUIN_HOME=~/.penguin/dev-data-cli PENGUIN_PROFILE=dev PORT=7369 -- tsx src/penguin.ts"
+ "penguin": "node ../../scripts/run-with-env.mjs ADELIE_HOME=~/.penguin/dev-data-cli ADELIE_PROFILE=dev PORT=7369 -- tsx src/penguin.ts"
},
"dependencies": {
"@modelcontextprotocol/client": "^2.0.0",
diff --git a/packages/cli/test/dev-entry-isolation.test.ts b/packages/cli/test/dev-entry-isolation.test.ts
index 092fcb7a..8deb1320 100644
--- a/packages/cli/test/dev-entry-isolation.test.ts
+++ b/packages/cli/test/dev-entry-isolation.test.ts
@@ -14,7 +14,10 @@
* The desktop's dev shell deliberately shares `~/.penguin/dev-data` with `dev:server`
* (a second server on a locked root is its attach-mode case, and the two surfaces
* sharing one dataset when used alternately is the point), and it binds no fixed port —
- * so it is pinned to that root rather than away from it.
+ * so it is pinned to that root rather than away from it. Its entry is also the one that
+ * still *spells* that root `PENGUIN_HOME`: its reader is the desktop shell, whose read side
+ * is not part of core's `state/boundary-env.ts`, so the two dev entries above are the ones
+ * that must write Adelie's names.
*/
import { readFileSync } from "node:fs";
import os from "node:os";
@@ -71,7 +74,28 @@ describe("dev entry point isolation (ports and data roots)", () => {
] as const) {
expect(defaults, `${name} must set its defaults through run-with-env`).not.toBeNull();
expect(defaults!.PORT, `${name} must pin a port`).toMatch(/^\d+$/);
- expect(defaults!.PENGUIN_HOME, `${name} must pin a data root`).toBeDefined();
+ expect(defaults!.ADELIE_HOME, `${name} must pin a data root`).toBeDefined();
+ }
+ });
+
+ it("the two dev entries write Adelie's spelling, not the pre-rename one", () => {
+ // The readers accept both spellings (`ADELIE_HOME` since 2.2a, the boundary variables
+ // since core's boundary-env.ts, new name first), so a stale one here would still run —
+ // which is exactly why it has to be pinned: the rename would keep hiding in the dev
+ // scripts otherwise. Only the desktop entry keeps `PENGUIN_HOME` (see the file header).
+ for (const [name, defaults] of [
+ ["dev:server", devServer],
+ ["penguin", devCli],
+ ] as const) {
+ expect(defaults!.ADELIE_PROFILE, `${name} must pin the profile Adelie's way`).toBe("dev");
+ expect(
+ defaults!.PENGUIN_HOME,
+ `${name} must not write the pre-rename root name`,
+ ).toBeUndefined();
+ expect(
+ defaults!.PENGUIN_PROFILE,
+ `${name} must not write the pre-rename profile name`,
+ ).toBeUndefined();
}
});
@@ -86,8 +110,8 @@ describe("dev entry point isolation (ports and data roots)", () => {
it("no two simultaneously runnable server entries share a data root", () => {
const roots = [
- expandHome(devServer!.PENGUIN_HOME!),
- expandHome(devCli!.PENGUIN_HOME!),
+ expandHome(devServer!.ADELIE_HOME!),
+ expandHome(devCli!.ADELIE_HOME!),
path.normalize(installedRoot),
];
expect(new Set(roots).size).toBe(roots.length);
@@ -101,7 +125,7 @@ describe("dev entry point isolation (ports and data roots)", () => {
it("the dev desktop shell stays on dev:server's root, by design", () => {
expect(devDesktop).not.toBeNull();
- expect(expandHome(devDesktop!.PENGUIN_HOME!)).toBe(expandHome(devServer!.PENGUIN_HOME!));
+ expect(expandHome(devDesktop!.PENGUIN_HOME!)).toBe(expandHome(devServer!.ADELIE_HOME!));
// No PORT: the embedded server allocates its own (PORT=0 + sticky preference).
expect(devDesktop!.PORT).toBeUndefined();
});
diff --git a/packages/core/src/internal/ports.ts b/packages/core/src/internal/ports.ts
index 4b353034..2f9bd7c5 100644
--- a/packages/core/src/internal/ports.ts
+++ b/packages/core/src/internal/ports.ts
@@ -31,7 +31,9 @@
* deliberately keep the pre-rename `~/.penguin` home, because the desktop's dev shell names
* `~/.penguin/dev-data` as the root it shares with `dev:server` (`app-identity.ts`, and the
* desktop test that pins it) — the two must move together, and the desktop tree is not
- * buildable here. Moving them is the remainder of ledger item 2.2.
+ * buildable here. Moving them is the remainder of ledger item 2.2. The **variable names** the
+ * dev entries write are Adelie's, though (`ADELIE_HOME` / `ADELIE_PROFILE`); only these paths
+ * are still spelled the old way.
*
* The development backend deliberately does **not** share 7364 with an installed one: the
* two are routinely running at once, and before they were split, `pnpm dev` either failed
diff --git a/packages/server/package.json b/packages/server/package.json
index 72138deb..ff50c005 100644
--- a/packages/server/package.json
+++ b/packages/server/package.json
@@ -61,7 +61,7 @@
"node": ">=24"
},
"scripts": {
- "dev": "node ../../scripts/dev-prebuild.mjs && node ../../scripts/run-with-env.mjs PENGUIN_HOME=~/.penguin/dev-data PENGUIN_PROFILE=dev PORT=7368 -- tsx watch src/index.ts",
+ "dev": "node ../../scripts/dev-prebuild.mjs && node ../../scripts/run-with-env.mjs ADELIE_HOME=~/.penguin/dev-data ADELIE_PROFILE=dev PORT=7368 -- tsx watch src/index.ts",
"start": "node --disable-warning=ExperimentalWarning dist/index.js",
"typecheck": "pnpm gen:ifaces && tsc --noEmit -p tsconfig.json",
"gen:ifaces": "node ../../scripts/gen-ifaces.mjs --project tsconfig.json --out src/ifaces.json",
diff --git a/packages/web/e2e/run.sh b/packages/web/e2e/run.sh
index 6e6560bc..a2d5f884 100644
--- a/packages/web/e2e/run.sh
+++ b/packages/web/e2e/run.sh
@@ -34,8 +34,8 @@ MOCK_PID=$!
echo "== start server =="
# ADELIE_SEED_ADMIN_PASSWORD pins the otherwise-random seeded admin password to the
# constant the specs use (ADMIN_PASSWORD in auth.mjs).
-PENGUIN_HOME="$DATA" PORT=$SRV_PORT HOST=127.0.0.1 PENGUIN_WEB_DB="$DATA/web.db" \
- PENGUIN_WEB_DIST="$ROOT/packages/web/dist" \
+ADELIE_HOME="$DATA" PORT=$SRV_PORT HOST=127.0.0.1 ADELIE_WEB_DB="$DATA/web.db" \
+ ADELIE_WEB_DIST="$ROOT/packages/web/dist" \
ADELIE_SEED_ADMIN_PASSWORD=penguin-2026 \
node "$ROOT/packages/server/dist/index.js" &
SRV_PID=$!
diff --git a/scripts/run-with-env.mjs b/scripts/run-with-env.mjs
index ac9a119f..575a0d2d 100644
--- a/scripts/run-with-env.mjs
+++ b/scripts/run-with-env.mjs
@@ -7,7 +7,7 @@
* Each assignment sets VAR **only when it is unset or empty** in the current environment —
* the JS equivalent of `VAR="${VAR:-value}" cmd`, which cmd.exe cannot parse (package.json
* scripts run under cmd.exe on Windows). An inherited value therefore wins, which is what makes
- * `PENGUIN_HOME=/somewhere pnpm dev` work; a child cannot tell that apart from an exported one.
+ * `ADELIE_HOME=/somewhere pnpm dev` work; a child cannot tell that apart from an exported one.
* Because it wins, it says so: any default the environment displaced is named on stderr before
* the command runs, so a shell-wide export cannot quietly redirect a dev script. A leading `~/` in the value expands to the user's
* home directory (the `$HOME/...` defaults). Then the command runs with inherited stdio and
@@ -45,10 +45,10 @@ for (const assignment of argv.slice(0, sep)) {
if (!env[name]) {
env[name] = value; // unset or empty -> default (the ${VAR:-value} rule)
} else if (env[name] !== value) {
- // An inherited value wins, and that is deliberate: `PENGUIN_HOME=/x pnpm dev` is the supported
+ // An inherited value wins, and that is deliberate: `ADELIE_HOME=/x pnpm dev` is the supported
// way to aim one command somewhere else, and a child process cannot tell that apart from an
// exported one — both are just process.env. What is not deliberate is finding out later. An
- // exported PENGUIN_HOME once sent `pnpm dev:server` at the release data root, where the
+ // exported ADELIE_HOME once sent `pnpm dev:server` at the release data root, where the
// desktop app already held the lock, and nothing said why the default had not applied.
overridden.push(`${name}=${env[name]} (default: ${value})`);
}