Skip to content

Implement the persistence policy module (ADR 0003)#11

Merged
zengsipei merged 1 commit into
mainfrom
feat/persistence-policy-module
Jul 7, 2026
Merged

Implement the persistence policy module (ADR 0003)#11
zengsipei merged 1 commit into
mainfrom
feat/persistence-policy-module

Conversation

@zengsipei

Copy link
Copy Markdown
Owner

Closes #10.

What

  • scripts/link-agent-home.sh — Persistence Manifest 的唯一运行时来源(.claude .codex .gemini .hapi),无条件 mkdir -p + ln -sfn;注释注明「布线跟随安装层」(ADR 0003 §4)。
  • 两个消费方post-create.sh 用它替换手写链接块;bootstrap.sh 调用经 compose.yaml 挂载进容器的脚本(与 bootstrap.sh 同方式,WORKSPACE_DIR 可指向任意项目)。
  • 修复三个 bug:agent-compose 缺 .hapi 链接;条件链接使全新 Volume-Backed 用户登录态写进容器 FS;ln -sf 嵌套进已有目录。
  • Dockerfile:Rebuildable Cache 链接维持烘焙不动,加交叉引用注释;内部布局映射从用户文档下沉到此处。
  • 文档按 ADR 0003 §6 分界重写.devcontainer/README.md 新增「持久化」政策节(丢失代价模型、Volume-Backed/Host-Backed 双后端、切换不搬货 + 手动迁移配方 + 分后端管理命令、清单加一行指引、Host-Backed 外部管理定位);删除 ~/.cache-volumes 布局表;agent-compose/README.md 改为链接所有者文档。

Verification

  • WSL 中功能测试通过:全新用户 4 个 dotdir 无条件建链(含 .hapi)、幂等重跑无嵌套、登录态经链接落入 Agent Home。
  • bash -n 全部脚本;docker compose config 校验挂载渲染正确。
  • /code-review 双轴(Standards / Spec)无硬性违规;已按建议内联 AGENT_HOME 常量、加固迁移配方。

Per ADR 0003 (#10):

- scripts/link-agent-home.sh is the single runtime source of the
  Persistence Manifest (.claude .codex .gemini .hapi); unconditional
  mkdir -p + ln -sfn.
- post-create.sh and agent-compose/bootstrap.sh both call it; the
  script is mounted into agent-compose containers like bootstrap.sh.
  Fixes: missing .hapi under agent-compose, conditional links losing
  fresh Volume-Backed login state, ln -sf nesting into existing dirs.
- Rebuildable Cache links stay baked in the Dockerfile (wiring follows
  the install layer, ADR 0003 §4); cross-referencing comments added at
  both wiring sites.
- User docs rewritten per the documentation boundary: loss-cost model,
  Volume-Backed/Host-Backed modes with migration recipe and per-backend
  management, add-a-tool guide; wiring details sunk into code comments;
  agent-compose/README.md links to the owner doc.
@zengsipei zengsipei merged commit 6c34032 into main Jul 7, 2026
2 checks passed
@zengsipei zengsipei deleted the feat/persistence-policy-module branch July 7, 2026 12:07
@zengsipei zengsipei mentioned this pull request Jul 7, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement the persistence policy module (ADR 0003)

1 participant