Skip to content

fix: dedupe the Nix socket in Pi's srt policy and name the failed sidecar write - #237

Merged
furedea merged 6 commits into
mainfrom
fix/dedupe-pi-nix-socket
Nov 12, 2026
Merged

furedea merged 6 commits into
mainfrom
fix/dedupe-pi-nix-socket

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Closes #236

変更

  • fix(pi): policy_op は /nix/var/nix/daemon-socket/socket を allowUnixSockets に未登録のときだけ追加する.設定元にあっても生成物に1回だけ入る.
  • fix(config-sync): sidecar_op のエラーが,失敗した操作(sidecar の書き込み)と対象パスを含む.
  • test(pi): pi_sandbox_smoke.mjs の missing srt ケースを,PATH から srt を含むディレクトリを除いて実行する.ホストに実物の srt があっても pi_bash_tool_runs_only_through_srt が通る.

テスト

  • pi_srt_policy_lists_the_nix_socket_once_when_the_source_has_it(設定元にソケットがある場合),pi_install_generates_complete_srt_policy_from_claude_source(ない場合は末尾に1回)
  • sidecar_without_a_declared_file_names_the_operation_and_target

🤖 Generated with Claude Code

@furedea

furedea commented Nov 12, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T07:49:38.886770Z aa0b963 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

Review summary

No findings. I didn't see any correctness bugs, security problems or missing tests.

  • pi_sandbox::policy_op: the Nix daemon socket is now added only when it isn't already listed. The order of sockets from the source is unchanged. The golden fixture and the two integration tests cover both cases: socket present in the source, and socket absent.
  • installed::sidecar_op: the error message is now built lazily with with_context, and it names both the failed operation and the target path. A new unit test covers this.

Blocking findings (P0/P1): 0

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: f99109f5f2

ℹ️ 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".

@furedea

furedea commented Nov 12, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown
Contributor

Review summary

No blocking findings (0 × P0/P1, no P2/P3 worth raising).

  • pi_sandbox::policy_op: the Nix daemon socket is now appended only when absent; the existing-path test now asserts exact ordering and a new test covers the already-present case.
  • installed::sidecar_op: the error context now names the operation and target path; the new unit test reaches it through Synced::into_ops and compiles against the current ConfigSync fields / FileOp: Debug.
  • pi_sandbox_smoke.mjs: removing every PATH entry that holds an srt keeps a host-installed srt from satisfying the missing-srt case. The assertions are bare rejects, so they would also pass if the filtered PATH dropped other tools. That is acceptable for a negative test.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 5a06209e4e

ℹ️ 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".

@furedea

furedea commented Nov 12, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown
Contributor

Review summary

No blocking findings.

  • policy_op: the Nix daemon socket is now added only when it is not already listed. The golden sandbox_policy.json still has exactly one entry, and both cases (socket in the source, socket missing from it) are tested.
  • sidecar_op: the error now names the operation and the target path. The new unit test drives this through Synced::into_ops.
  • pi_sandbox_smoke.mjs: spawn("srt") inherits process.env when it runs, so removing directories that contain srt from PATH does isolate the missing-srt case from a host install.

P0/P1: 0

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6aace0312e

ℹ️ 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".

Comment thread tests/pi_sandbox_smoke.mjs Outdated
register({ getAllTools() { return [...tools.values()]; }, registerTool(value) { tools.set(value.name, value); if (value.name === 'bash') tool = value; }, on(event, fn) { if (event === 'session_shutdown') cleanups.push(fn); } });
rmSync(join(bin, 'srt'));
// A host may install a real srt; the missing-srt case must not resolve it.
process.env.PATH = process.env.PATH.split(delimiter).filter(dir => !existsSync(join(dir, 'srt'))).join(delimiter);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve git while hiding srt from PATH

When the real srt and the only git executable share a PATH directory (for example, a consolidated Nix profile), this removes git as well. Every tool call invokes prepare(), which reruns git rev-parse; losing git changes the cached repository result and raises Sandbox git layout changed before srt is resolved. The broad assert.rejects calls therefore pass without exercising the missing-srt behavior this regression test is intended to cover, so construct a PATH that retains a known git while excluding only srt, and assert the expected missing-executable error.

Useful? React with 👍 / 👎.

@furedea

furedea commented Nov 12, 2026

Copy link
Copy Markdown
Owner

@codex review

1 similar comment
@furedea

furedea commented Nov 12, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown
Contributor

Review summary

No findings. Nothing blocks the merge (0 P0/P1).

What I checked:

  • pi_sandbox::policy_op: The Nix daemon socket is now added only when it isn't already in the list. The source's order is kept, and the new socket goes last. Two integration tests cover this: one where the source already has the socket and one where it doesn't (the second also checks the exact list).
  • installed::sidecar_op: The error message now names the failed operation and the target path. The new unit test reaches the None branch of sidecar_file(), and the ConfigSync literal in it matches the struct's current fields.
  • pi_sandbox_smoke.mjs: The test now drops every PATH directory that contains srt, but keeps git through a symlink. It needs git because prepare() runs git rev-parse. The helper runs through process.execPath, so dropping those directories can't remove node. The /srt: not found/ check matches the exec failure message from both dash and bash when either is /bin/sh. execFileSync includes the child's stderr in the error message, so the assertion sees it.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: aa0b963fce

ℹ️ 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".

@furedea
furedea merged commit 1ccafe0 into main Nov 12, 2026
21 checks passed
@furedea
furedea deleted the fix/dedupe-pi-nix-socket branch November 12, 2026 07:51
furedea pushed a commit that referenced this pull request Nov 12, 2026
🤖 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>
furedea added a commit to furedea/dotfiles that referenced this pull request Nov 12, 2026
…463)

agent-config を v0.1.3,agent-harness を v0.9.13 に更新し,片付けスクリプトの修正と Pi の srt
設定の修正を取り込む.

| 入力 | 変更前 | 変更後 |
| --- | --- | --- |
| agent-config | `0638e4b` | `9e2843c`(v0.1.3) |
| agent-harness | `37de3ac` | `b365277`(v0.9.13) |

| 主な変更 | 中身 |
| --- | --- |
| furedea/agent-config#184 | `cleanup_worktrees.py` がマージ済みブランチの worktree
を残すとき理由を1行出す.残す理由の行が後続の worktree で消える不具合も修正 |
| furedea/agent-harness#237 | Pi の srt 設定の Nix ソケットを1回だけにする.sidecar・Pi
設定生成の失敗メッセージに操作を含める.PATH の srt に依存しないテスト |

## 検証

- [x] `nix build .#darwinConfigurations.mba.system` が成功
- [x] 生成された `sandbox_policy.json` の `allowUnixSockets` が
`["/nix/var/nix/daemon-socket/socket"]` の1件(`37de3ac`→`1ccafe0` 時点で確認)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: furedea <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

Deduplicate the Nix socket in Pi's srt policy and name the failed sidecar operation

1 participant