Implement the persistence policy module (ADR 0003)#11
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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可指向任意项目)。.hapi链接;条件链接使全新 Volume-Backed 用户登录态写进容器 FS;ln -sf嵌套进已有目录。.devcontainer/README.md新增「持久化」政策节(丢失代价模型、Volume-Backed/Host-Backed 双后端、切换不搬货 + 手动迁移配方 + 分后端管理命令、清单加一行指引、Host-Backed 外部管理定位);删除~/.cache-volumes布局表;agent-compose/README.md改为链接所有者文档。Verification
.hapi)、幂等重跑无嵌套、登录态经链接落入 Agent Home。bash -n全部脚本;docker compose config校验挂载渲染正确。AGENT_HOME常量、加固迁移配方。