Skip to content

fix(ci): exclude the vetted-ops policy from the sandbox-write-denied hooks - #1309

Merged
potiuk merged 1 commit into
mainfrom
fix/prek-exclude-vetted-ops-policy
Sep 21, 2026
Merged

potiuk merged 1 commit into
mainfrom
fix/prek-exclude-vetted-ops-policy

Conversation

@potiuk

@potiuk potiuk commented Sep 21, 2026

Copy link
Copy Markdown
Member

Summary

  • Follow-up to fix(sandbox): deny agent edits to the vetted-ops policy #1308. That PR added a permissions.deny rule on .apache-magpie-overrides/tools/vetted-ops/** but did not extend the sandbox_write_denied exclude in .pre-commit-config.yaml that exists for exactly this case.
  • A permissions.deny rule becomes a sandbox filesystem write-deny, so end-of-file-fixer, mixed-line-ending and trailing-whitespace abort prek run --all-files inside an agent session with Operation not permitted — even though the file needs no fix.
  • Adds the path to the exclude, and states the coupling in the comment, since it is easy to miss: a new permissions.deny rule on an in-repo path needs that path added here too.

Type of change

  • CI / dev loop (prek, workflows, validators)

Test plan

  • prek run --all-files exits 0 inside the agent sandbox with no bypass, which is the property the exclude block exists to preserve. Before this change it aborted with:
error: Failed to run hook `end-of-file-fixer`
  caused by: failed to open file `.apache-magpie-overrides/tools/vetted-ops/config.toml`: Operation not permitted (os error 1)

RFC-AI-0004 compliance

  • Sandbox — no change to the deny rules themselves; only the hooks' file filter

Linked issues

Refs #1308

Notes for reviewers

The vetted-ops policy loses no coverage by skipping EOF / whitespace / line-ending normalisation: vetted_ops.config parses it on every dispatch, so a malformed file fails the call.

Dropping Write(...) and keeping Edit(...) is not an alternative fix — Edit(.claude/settings.json) has no companion Write rule and still produces the sandbox write-deny, which is why .claude/settings.json was already in this exclude.

🤖 Generated with Claude Code

…hooks

#1308 added a `permissions.deny` rule on
`.apache-magpie-overrides/tools/vetted-ops/**` without extending the
`sandbox_write_denied` exclude that exists for exactly this case. A deny
rule becomes a sandbox filesystem write-deny, so end-of-file-fixer,
mixed-line-ending and trailing-whitespace abort `prek run --all-files`
inside an agent session with `Operation not permitted`, even though the
file needs no fix.

The policy keeps its coverage: `vetted_ops.config` parses it on every
dispatch, so a malformed file fails the call.

Also states the rule in the comment, since the coupling is easy to miss:
a new `permissions.deny` rule on an in-repo path needs that path added
here too.

Generated-by: Claude Opus 5
@potiuk
potiuk merged commit 85d16c9 into main Sep 21, 2026
10 checks passed
@potiuk
potiuk deleted the fix/prek-exclude-vetted-ops-policy branch September 21, 2026 01:54
potiuk added a commit to potiuk/magpie that referenced this pull request Sep 21, 2026
The marker sat at 0e7012b, where apache#1306 left it, while apache#1305 and
apache#1307-apache#1310 landed on top. Reviewing that delta:

- apache#1305 (stats events cache `updatedAt`) and apache#1307 (dev version bump)
  touch no behaviour any spec describes; no spec references
  `fetch_issues` or the events cache.
- apache#1308, apache#1309 and apache#1310 are the vetted-ops sandbox work, and the
  `excludedCommands` section this branch already rewrites is where
  they belong. That rewrite covers all three.

So the delta is documented and the marker can move. This is the
by-hand route AGENTS.md allows for a small known gap, not a full
`loop.sh update` pass — it reconciles these five commits rather than
re-auditing every skill, tool and modes.md row.

Generated-by: Claude Opus 5
@potiuk potiuk added the family:ci .github workflows, prek, validators label Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

family:ci .github workflows, prek, validators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant