Repository navigation
greenproof 0.2.0
OpenCode 2.x support, one plugin for Claude Code, Codex and Cursor, one decision per stop when the gate is installed twice, and greenproof check inside sandboxes that cannot write .git.
Install: uvx greenproof@0.2.0 --version or pipx install greenproof==0.2.0 (PyPI).
Added
- A plugin for Claude Code, Codex and Cursor (
plugins/greenproof) that installs the Stop
and SessionStart hooks without runninggreenproof init, with a marketplace file for each
agent (.claude-plugin/,.agents/plugins/,.cursor-plugin/). Each manifest names its
own hooks file, so no agent loads another's. The hooks runuvx greenproof@<version>,
pinned to the release; the plugin also carries a skill that tells the agent how to answer
a block. scripts/bump_version.py X.Y.Z, which sets the version in_version.py, the manifests and
every pinned command in the plugin, andtests/test_plugins.py, which fails when any of
them differs from__version__and checks each manifest against its vendor's format.scripts/make_icon.py, the standard-library script that draws the plugin icon.- An OpenCode 2.x plugin (
integrations/opencode, packageopencode-greenproof, also
packaged inside greenproof): on a top-level session going idle it runs
greenproof check --hook opencodeand continues the same run withctx.session.synthetic
on a block; a release is a console warning and every failure fails open. It starts a
session on the first prompt of a top-level session (theprompthook), skips subagent
sessions, runs one check per session at a time and gives way to a second copy loaded in the
same process. Plain ES module with onlynode:imports; 2.x only. greenproof init --agents opencodewrites.opencode/plugins/greenproof.jswith the hook
command set. The file is replaced only when its first line says greenproof wrote it; any
other file there is a usage error (exit 4) and nothing is written.--agents autoalso
installs it when.opencode/,opencode.jsonoropencode.jsoncexists.- A CI job that runs
node --teston the plugin (actions/setup-node pinned to a commit) and
checks thatnpm packlists onlyindex.js,README.md,LICENSEandpackage.json. scripts/e2e/opencode.py, an end-to-end run of the plugin in the real OpenCode CLI against
a fake OpenAI-compatible model server (--self-testchecks only the server). It is not
part of pytest.scripts/bump_version.pyalso sets the npm package's version and the command pinned in
its copy of the plugin.check --hook opencodeandsession-start --hook opencode, for the OpenCode plugin: the
payload carriessession_idandcwd, and the output is Codex's protocol (block, pass,
release) and Claude Code's session-start output.- Duplicate hooks for one stop. The gate can be installed twice (a plugin and the hooks
initwrites), and the agent then runs both in parallel. Everything after repository
discovery runs under an exclusive lock on<git-dir>/greenproof/hook.lock, the hook state
records the payload's fingerprint (a sha256 of the sorted, compact payload), the decision
and the block message, and a second hook for the same stop (same payload, same tree)
outputs that decision again (at most three replays) instead of finding the first one's
block and releasing the agent.
When the lock file cannot be opened, the hook runs without the lock. forkin the SessionStart matchers of the Claude Code and Codex CLI hooksinitwrites.
Both agents document it as a source; the session marker is kept, as forresume.
Fixed
greenproof checkin local mode no longer exits 4 when the git directory is read-only, as
in an agent sandbox that lets the agent write the working tree but not.git(Codex's
workspace-write):git add -Acould not store the snapshot's objects. When the snapshot
fails and a probe file cannot be created in the object directory, greenproof retries with
a temporary object directory (GIT_OBJECT_DIRECTORY, with the repository's objects as
GIT_ALTERNATE_OBJECT_DIRECTORIES) for every git command of the run, deletes it on exit
and writes nothing under the git directory, so no pass is cached. The revert check is
skipped with a note,--isolateexits 4, and the report carries a note. Hook and CI mode
still fail closed on a git failure.
Changed
- A pass is now recorded in the hook state instead of clearing it, so a duplicate hook for
the same stop can replay it. Nothing to verify still clears the state. A state file
written by 0.1.0 is read as a block with no fingerprint. suppress.addedapplies each generic pattern only where it has an effect.|| true,
; true,set +eand the git--no-verifypattern fire in shell-capable files (scripts,
makefiles, justfiles, CI and container files,package.json,pyproject.toml,
tox.ini,setup.cfg,.husky/and.githooks/), and--passWithNoTestsalso in
JavaScript and TypeScript. They no longer fire in.tomlcase files,.jsondata,
prose or source files of other languages.- The README says that
uvxhook commands needuvon PATH.
Full changelog: v0.1.0...v0.2.0