You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@magpie.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2026/10/05 22:54:05 UTC
[PR] fix(container-gateway): require a back-link when a .git file names the common dir itself [magpie]
potiuk opened a new pull request, #1537:
URL: https://github.com/apache/magpie/pull/1537
<!-- SPDX-License-Identifier: Apache-2.0
https://www.apache.org/licenses/LICENSE-2.0 -->
## Summary
- `container-gateway` accepts a checkout's git common directory as the anchor for its run directory only when that directory links back to the checkout. For a linked worktree that link is `<common>/worktrees/<name>/gitdir`.
- A `.git` file whose `gitdir:` names the common directory itself (the submodule layout) skipped the link check. Any user-owned directory with `HEAD` and `objects/` was accepted, including the `.git` of another repository. `serve` then created its run directory and sockets there, and `stop` read the pid file from there.
- That layout is now accepted only when the common directory's `core.worktree` resolves to this checkout, which is how git records a submodule's working tree. Otherwise it refuses and points at `--run-dir`.
- The docstring now states that the ownership check does not separate the agent from the operator, since both run as the same user. The back-link is what ties the anchor to the checkout.
- `FRAMEWORK_FINGERPRINT` is regenerated, because `tools/container-gateway/src` is part of the hash.
## Type of change
- [ ] Skill change (`.claude/skills/<name>/`) — eval fixtures updated below
- [ ] Tool / bridge contract (`tools/<system>/*.md`)
- [x] Python package (`tools/*/` with `pyproject.toml`)
- [ ] Groovy reference impl
- [ ] Cross-cutting (RFC, AGENTS.md, sandbox, privacy-LLM)
- [ ] Documentation (`docs/`, `README.md`, `CONTRIBUTING.md`)
- [ ] Project template (`projects/_template/`)
- [ ] CI / dev loop (`prek`, workflows, validators)
- [ ] Other
## Test plan
- [x] New tests in `tools/container-gateway/tests/test_layers.py`:
- a `.git` naming the git directory of another repository is refused, and nothing is created there;
- a `.git` naming the main checkout's `.git` is refused;
- a submodule-style git directory whose `core.worktree` points elsewhere is refused;
- `stop` through such a `.git` exits before it would signal anything;
- a real submodule (`.git/modules/sub` with `core.worktree = ../../../sub`) still serves from its own git directory.
- [x] The four refusal tests fail on `main` and pass with the change
- [x] `container-gateway` suite passes locally (the unix-socket bind tests are skipped in the sandbox and run in CI)
- [x] Pre-commit hooks pass, including `isolated-setup-fingerprint`
## RFC-AI-0004 compliance
No principle touched.
## Linked issues
None.
---
Generated-by: Claude Opus 5 (assisted; reviewed by the PR author)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@magpie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(container-gateway): require a back-link when a .git file names the common dir itself [magpie]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #1537:
URL: https://github.com/apache/magpie/pull/1537
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@magpie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org