Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ python3 tests/tools/gate_missions_e2e.py --claude claude --plugin-dir plugins/pa
`gate_missions_e2e.py` plays the main agent and each subagent with `tests/tools/fake_agents.py`, which tells their
conversations apart by the prompt. For Codex, `python3 tests/tools/gate_codex_e2e.py` installs the plugin from this
checkout into a scratch `CODEX_HOME`, trusts its hooks, and drives real Codex with the lab's scripted model, for $0;
it needs `codex` 0.159 or newer on `PATH`, and `--source vladimirrott/patton-protocol` tests the published copy.
it needs `codex` 0.159 or newer on `PATH`, and `--source agentsmith-tools/patton-protocol` tests the published copy.

All of them end with `all checks passed` or a list of failures. `--installed` tests the plugin installed for your user
instead; it uses your real home and marks the scratch project as trusted in `~/.claude.json`, so the VM script uses
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Patton Protocol

![CI](https://github.com/vladimirrott/patton-protocol/actions/workflows/ci.yml/badge.svg)
![CI](https://github.com/agentsmith-tools/patton-protocol/actions/workflows/ci.yml/badge.svg)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

`patton-gate` is a hook for Claude Code and Codex CLI. Before your coding agent changes, moves or deletes a file that
Expand Down Expand Up @@ -83,7 +83,7 @@ An earlier study put a gate of the same design inside a sandbox, and harm was 0.
**Claude Code** (2.1.295 or newer, `python3` 3.10 or newer), from your shell:

```sh
claude plugin marketplace add vladimirrott/patton-protocol --sparse .claude-plugin plugins
claude plugin marketplace add agentsmith-tools/patton-protocol --sparse .claude-plugin plugins
claude plugin install patton-gate@patton-protocol
```

Expand All @@ -95,7 +95,7 @@ records, took two minutes on a fast link, and Claude Code stops a clone after tw
which Codex skips until you do:

```sh
codex plugin marketplace add vladimirrott/patton-protocol --sparse .agents --sparse .claude-plugin --sparse plugins && codex plugin add patton-gate@patton-protocol && python3 "${CODEX_HOME:-$HOME/.codex}"/plugins/cache/patton-protocol/patton-gate/*/scripts/patton_gate.py codex-trust
codex plugin marketplace add agentsmith-tools/patton-protocol --sparse .agents --sparse .claude-plugin --sparse plugins && codex plugin add patton-gate@patton-protocol && python3 "${CODEX_HOME:-$HOME/.codex}"/plugins/cache/patton-protocol/patton-gate/*/scripts/patton_gate.py codex-trust
```

Run the trust step again after `codex plugin marketplace upgrade`: Codex drops trust when a hook changes. Codex hooks cannot ask a
Expand Down
2 changes: 1 addition & 1 deletion docs/plans/2026-10-22-gate-plugin-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ person installs with one command and keeps on in daily work.
## What the user gets

```sh
claude plugin install patton-gate --marketplace vladimirrott/patton-protocol
claude plugin install patton-gate --marketplace agentsmith-tools/patton-protocol
```

From the next session on, Claude Code asks before any tool call that would change, move or delete a file that
Expand Down
2 changes: 1 addition & 1 deletion gate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A Claude Code hook that asks before the agent changes a file that existed when t
One file, standard library only.

**To use the gate, install the plugin** ([`plugins/patton-gate`](../plugins/patton-gate/README.md)):
`claude plugin marketplace add vladimirrott/patton-protocol --sparse .claude-plugin plugins`, then
`claude plugin marketplace add agentsmith-tools/patton-protocol --sparse .claude-plugin plugins`, then
`claude plugin install patton-gate@patton-protocol`. This directory holds the exact
file the 2026-10-21 pre-registration froze, and it never changes, so the study can be replayed against it. The
plugin keeps its classifier and decision rules, passes the same bypass corpus, and adapts it for daily use (it asks
Expand Down
4 changes: 2 additions & 2 deletions plugins/patton-gate/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"name": "Vladimir Rotariu",
"url": "https://github.com/vladimirrott"
},
"homepage": "https://github.com/vladimirrott/patton-protocol/tree/main/plugins/patton-gate",
"repository": "https://github.com/vladimirrott/patton-protocol",
"homepage": "https://github.com/agentsmith-tools/patton-protocol/tree/main/plugins/patton-gate",
"repository": "https://github.com/agentsmith-tools/patton-protocol",
"license": "MIT",
"keywords": [
"safety",
Expand Down
4 changes: 2 additions & 2 deletions plugins/patton-gate/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"name": "Vladimir Rotariu",
"url": "https://github.com/vladimirrott"
},
"homepage": "https://github.com/vladimirrott/patton-protocol/tree/main/plugins/patton-gate",
"repository": "https://github.com/vladimirrott/patton-protocol",
"homepage": "https://github.com/agentsmith-tools/patton-protocol/tree/main/plugins/patton-gate",
"repository": "https://github.com/agentsmith-tools/patton-protocol",
"license": "MIT",
"hooks": "./hooks/codex-hooks.json"
}
4 changes: 2 additions & 2 deletions plugins/patton-gate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ settle ([Triage](#let-an-analyst-answer-the-easy-questions)), rules that keep th
## Install

```sh
claude plugin marketplace add vladimirrott/patton-protocol --sparse .claude-plugin plugins
claude plugin marketplace add agentsmith-tools/patton-protocol --sparse .claude-plugin plugins
claude plugin install patton-gate@patton-protocol
```

Expand Down Expand Up @@ -349,7 +349,7 @@ which files that command touches.
Codex CLI 0.159 or newer, and `python3` 3.10 or newer:

```sh
codex plugin marketplace add vladimirrott/patton-protocol --sparse .agents --sparse .claude-plugin --sparse plugins && codex plugin add patton-gate@patton-protocol && python3 "${CODEX_HOME:-$HOME/.codex}"/plugins/cache/patton-protocol/patton-gate/*/scripts/patton_gate.py codex-trust
codex plugin marketplace add agentsmith-tools/patton-protocol --sparse .agents --sparse .claude-plugin --sparse plugins && codex plugin add patton-gate@patton-protocol && python3 "${CODEX_HOME:-$HOME/.codex}"/plugins/cache/patton-protocol/patton-gate/*/scripts/patton_gate.py codex-trust
```

Codex runs a plugin's hooks only after you trust them. The last command does what Codex's `/hooks` review does: it
Expand Down
2 changes: 1 addition & 1 deletion plugins/patton-gate/scripts/patton_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3175,7 +3175,7 @@ def ours(result: dict) -> list[dict]:
hooks = ours(call(2, "hooks/list", {"cwds": [os.getcwd()]}))
if not hooks:
stdout.write("Codex lists no patton-gate hooks. Install the plugin first:\n codex plugin marketplace add "
"vladimirrott/patton-protocol --sparse .agents --sparse .claude-plugin --sparse plugins "
"agentsmith-tools/patton-protocol --sparse .agents --sparse .claude-plugin --sparse plugins "
"&& codex plugin add patton-gate@patton-protocol\n")
return 1
value = {h["key"]: {"trusted_hash": h["currentHash"]} for h in hooks}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_gate_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_the_plugin_needs_nothing_outside_its_directory(self):

def test_every_readme_gives_the_same_working_install_command(self):
market = json.loads((REPO_ROOT / ".claude-plugin" / "marketplace.json").read_text())
command = (f"claude plugin marketplace add vladimirrott/{market['name']} --sparse .claude-plugin plugins")
command = (f"claude plugin marketplace add agentsmith-tools/{market['name']} --sparse .claude-plugin plugins")
install = f"claude plugin install patton-gate@{market['name']}"
self.assertEqual(market["name"], "patton-protocol", "the marketplace name is the repository name")
for readme in (REPO_ROOT / "README.md", PLUGIN / "README.md", REPO_ROOT / "gate" / "README.md"):
Expand Down
2 changes: 1 addition & 1 deletion tests/tools/gate_codex_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""End to end, for $0: install the patton-gate plugin into real Codex CLI the way a person does, then drive it.

python3 tests/tools/gate_codex_e2e.py # the marketplace in this checkout
python3 tests/tools/gate_codex_e2e.py --source vladimirrott/patton-protocol # the published one
python3 tests/tools/gate_codex_e2e.py --source agentsmith-tools/patton-protocol # the published one

Every codex call runs with a scratch HOME and CODEX_HOME, so the person's own ~/.codex and login are never read.
The model is the lab's scripted Responses endpoint (lab/patton_lab/codex/fake_upstream.py) on 127.0.0.1, with a
Expand Down
4 changes: 2 additions & 2 deletions tests/vm/in-vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ step "install the plugin with one command (source: ${PATTON_VM_SOURCE:-checkout}
t0=$(when)
if [ "${PATTON_VM_SOURCE:-checkout}" = github ]; then
# the README's two commands: a full clone of the repository is 550 MB and outlasts Claude Code's git timeout
claude plugin marketplace add vladimirrott/patton-protocol --sparse .claude-plugin plugins
claude plugin marketplace add agentsmith-tools/patton-protocol --sparse .claude-plugin plugins
claude plugin install patton-gate@patton-protocol -y
else
claude plugin install patton-gate --marketplace "$HOME/patton-protocol" -y
Expand Down Expand Up @@ -102,7 +102,7 @@ export NODE_OPTIONS="--network-family-autoselection-attempt-timeout=2000"
npm install -g --silent @openai/codex@0.159.0
codex --version
if [ "${PATTON_VM_SOURCE:-checkout}" = github ]; then
codex_source="vladimirrott/patton-protocol"
codex_source="agentsmith-tools/patton-protocol"
else
codex_source="$HOME/patton-protocol"
fi
Expand Down
Loading