Repository navigation
fix(install): publish atomically and keep Claude settings keys the harness does not own - #219
Conversation
…rness does not own `install` now renders into staging and publishes each directory through a sibling temporary directory plus rename. The whole publication is all-or-nothing: a failing step restores every path already replaced from a backup, so hooks never point at scripts that were deleted midway. A source without its hooks directory now fails validation and install, and leaves the installed directories untouched, instead of emptying them. Behavior change: CLI `install` no longer overwrites `~/.claude/settings.json` wholesale. It carries over the installed file and applies the ADR-0016 merge: generated top-level keys replace the existing ones and every other top-level key, including those Claude Code wrote, is kept. `permissions` stays owned by the source and is replaced as a whole. The result now matches the Home Manager `sync-claude-settings` path, including `~/` expansion in excluded commands. Closes #216 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Review summaryNothing blocks the merge. I found no P0 or P1 issues.
What I checked and found sound: replacing directories via a sibling copy and a rename in 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1d61a8230
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Address review findings on the atomic install: - The executor now stages all replacements next to their targets first, and only then swaps them in with renames, so live hooks and skills are never missing while a directory is being copied. - Rollback restores every swapped path and reports all restore failures instead of stopping at the first one. - MemoryFileSystem gains stage, swap and restore failure modes, with tests for each. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Review summary1 blocking finding (P1)
I checked the atomic publish logic (stage-all → swap → roll back newest first). It looked correct for the current 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd8961aa34
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
… best effort - Merge the generated Claude settings without expanding `~/`. The prefix is not always the home (the Home Manager build installs into the Nix store), so expansion stays with the sync that knows the real home. - A failure to delete a backup after every swap succeeded no longer fails the install. - Move the home-path expansion helpers into their own module to stay under the file-length limit. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex review |
Review summaryNo blocking findings (0 × P0/P1). I checked:
One inline comment:
A note that is not a code defect: the PR description says CLI I did not run |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d21e22cc3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…rectories - Replace a regular file by hard-linking a backup and renaming the staged file over it, so the live file is never missing while it is swapped. - Create the target parent directories before staging, record them, and remove them again when the install is rolled back. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex review |
|
Automated review: no blocking findings I read the PR's diff and checked the code it touches. I found no correctness, security or test-coverage problems worth an inline comment. What I checked:
Non-blocking notes:
🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14a3c8c968
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Remove the parent directories copy_dir created when it fails, and treat a backup that cannot be deleted after the swap as a harmless leftover. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
Review summary (read-only) No blocking findings (0 × P0/P1). What I checked:
One P3 (inline): the commit/PR text says the CLI install expands Minor note, not filed: an existing |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c116a125e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Remove the published path before renaming the backup back unless both are non-directories, so rolling back a directory that was replaced by a file no longer fails with NotADirectory. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
1 similar comment
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
Review summaryNo P0 or P1 findings. One P2 is posted inline.
What I checked and found sound:
I could not run 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ce2b09cbb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…tories - A swap whose rename and restore both fail now says where the original backup is instead of dropping the rename error. - The rollback removes the empty directories the install created even when some restore failed. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex review |
|
Review summary (read-only) No P0–P3 findings. What I checked:
I could not run 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1a11b82ad0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…_missing_parents Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex review |
Review summaryNo blocking findings (0 P0/P1). No inline comments posted. What I checked:
The tests cover failures during staging, swapping and restoring, the parent-directory rollback, and settings preservation. I did not run |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🤖 I have created a release *beep* *boop* --- ## [0.9.13](agent-harness-v0.9.12...agent-harness-v0.9.13) (2026-11-12) ### Features * **codex:** apply the secret path policy to the guarded filesystem ([#233](#233)) ([0830fd9](0830fd9)) * **pi:** run Pi shell and file tools inside srt ([#228](#228)) ([37de3ac](37de3ac)) ### Bug Fixes * dedupe the Nix socket in Pi's srt policy and name the failed sidecar write ([#237](#237)) ([1ccafe0](1ccafe0)) * fail on missing HOME, bound GitHub API waits, reject unknown hook keys ([#218](#218)) ([c0b936d](c0b936d)) * **install:** publish atomically and keep Claude settings keys the harness does not own ([#219](#219)) ([c914c76](c914c76)) * **pi:** confirm ask decisions and deliver skills, instructions, and settings ([#223](#223)) ([2e755af](2e755af)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: furedea-release[bot] <353651101+furedea-release[bot]@users.noreply.github.com>
概要
installを途中で失敗しても壊れない形にし,ADR-0016 の「管理キーだけ置き換える」を CLI 経路でも守る.Closes #216
計画: #216 (comment)
変更内容
install_executor::executeは all-or-nothing.全ての置換を対象の隣にステージングしてから,rename で入れ替える.ステージング失敗時は本番パスに触れない.入れ替え失敗時は入れ替え済みの全パスを復元し,失敗した復元も全て報告する.作成した親ディレクトリも元に戻すcopy_dirはソースが無ければエラーにし,同じ仕組みで入れ替えるFileSystemにcreate_parents/stage_*/swap/restore/discardを追加し,MemoryFileSystemにステージング・入れ替え・復元の失敗モードを追加hooks)も確認する.minimal プロファイルに無い他プロバイダの任意ディレクトリは,従来どおり空ディレクトリとして扱うinstallは既存の.claude/settings.jsonを引き継ぎ,ADR-0016 のマージ(生成されたトップレベルキーを置き換え,他は残す)を適用する.permissionsは従来どおり source が正で丸ごと置き換え挙動変更
installは Claude のsettings.jsonを丸ごと上書きしなくなる(安全側).生成対象外のトップレベルキーは残るsettings.jsonが不正な JSON,またはルートがオブジェクトでない場合,installは上書きせずエラーになる~/の展開は行わない.Home Manager のビルドは prefix に Nix ストアを指定するため,展開は実ホームを知る sync に任せる検証
cargo test: 全テスト成功(lib 161,golden を含む統合テスト)cargo clippy -- -D warnings,cargo fmt --check,pre-commit の file-length / ls-lint: 成功~/を展開しないこと範囲外
I/O ポートの統一と sync の一本化は #217.他レーンのファイルには触れていない.
🤖 Generated with Claude Code