Skip to content

v0.0.9

Choose a tag to compare

@github-actions github-actions released this 13 Nov 17:53
· 26 commits to main since this release
0f995fd

Install on macOS or Linux:

curl -fsSL https://github.com/pedroknigge/pregate/releases/download/v0.0.9/install.sh | sh

Install on Windows PowerShell:

irm https://github.com/pedroknigge/pregate/releases/download/v0.0.9/install.ps1 | iex

Each archive and SHA256SUMS has a Sigstore bundle (.bundle) from cosign sign-blob (GitHub OIDC) and a GitHub artifact attestation. Verification steps are in docs/guides/installation.md.

Release 0.0.9

Pregate v0.0.9, core 0.0.1. macOS ARM64 stays the stable platform. Linux and Windows archives stay experimental until native validation is recorded.

Install 0.0.9, then review the project update it prepares (pregate update --project --preview) and approve that exact digest. A global update prepares that review for each enabled project whose lock still pins an older engine.

This release makes the first review of a new project one approval, and it keeps approval in a person's terminal. A project that already uses ArkGate can import that layer map without being judged twice. Project Cursor hooks answer preToolUse in Cursor's own permission object, and a workspace that also has project Claude hooks records one evaluation per tool call. Advisor mode says when a file was not checked. Pack matchers that fired on the wrong shape are narrower, and a Go sh -c call whose script is a variable is reported.

One approval for a new project

guide --preview on a project with no contract now prepares one digest. It holds the contract, the layer map derived from folder names, and the rules compile can make from AGENTS.md, CLAUDE.md, and .cursorrules, together with the detected scope and the selected packs.

  • --layers <layers.json> replaces the derived map when no ark.config.json is present.
  • Repeatable --compile <proposals.json> adds rules the agent completed with examples.
  • After a contract exists, those two flags are refused. layers apply, compile apply, and import arkgate each prepare their own review.

pregate import arkgate --preview reads ark.config.json and proposes the layer map plus coexist.arkgate. A layer rule ArkGate already enforces is listed in ownedByArkgate and is not evaluated again. A key the ArkGate schema does not name is rejected. On a new project the guide detects that file and includes the import; a hand-written layer file is not the map that review uses. The shell guard allows the preview when every word is literal and the command carries no --yes or --digest.

Test apps under packages/<name>/test/ stay inside the owning package. SvelteKit's packages/kit/test/apps/async has its own manifest and a nested package that owns @sveltejs/kit. That split used to make guide --preview throw, and the message claimed a contract had been kept when none existed. A nested owner anywhere else still needs an explicit scope. guide --json reports that scope error and exits 1. guide --preview --packs <ns,ns> names the packs the review keeps.

Approval stays in a separate terminal

A harness ! line cannot approve. Claude Code, Codex, Grok, agy, OpenCode, and Cursor ! lines have no terminal. A detached pregate approve with piped stdin still refuses before /dev/tty. The refusal names the project root and the command to run in Terminal or iTerm, or in a new PowerShell window on Windows. On agy 1.5.6 that ! line was refused because stdin is not a terminal. The earlier note covered only 1.2.17. The approval code stays withheld when stdout is not a terminal. The line that tells the human which command to type stays visible.

Codex can attach a pty to exec_command, and write_stdin types into that pty with no further PreToolUse. The Pre hook sees only the command. A non-literal script, including bash -c 'while read l; do eval "$l"; done', is denied as shell-write before that child starts, so there is no terminal for write_stdin to type pregate approve into. script, tmux, and screen stay denied.

When an approval applies and Git cannot commit it, the message keeps the last lines of Git's stderr. A pre-commit hook's reason is that text. The message also prints the command that commits once the hook can succeed. Hooks are not skipped.

A clean checkout of a branch that already exists

A plain git switch <branch> or git checkout <branch> of one existing branch on a clean worktree is allowed. The files that differ arrive with that branch. A protected path among them is still denied. A dirty worktree, --force, --discard-changes, --detach, a new branch, a commit or tag, a path checkout (git checkout -- <file>), and any change under .pregate/ stay denied.

Advisor mode says when a file was not checked

import("m").Type<Args> and the same form nested, qualified, or used as typeof import("m") were syntax errors in .ts, .d.ts, and .tsx. An audit of a file that used them exited incomplete, and advisor mode reported the file as clean. Those type queries now parse. A file that still does not parse is PREGATE WARN syntax in advisor mode. Enforce still denies it. Malformed type arguments stay syntax errors.

An import that cannot be resolved is no longer an unconditional deny. In advisor mode it blocks only when an enforced static rule would be skipped. Otherwise the call warns (PREGATE WARN unresolvable-import) that the file was not checked, because no enforced rule applies to it. Shadow still blocks every unresolved import, because integrity stays enforced there. Enforce stays fail-closed.

Cursor answers preToolUse in its own words

Project .cursor/hooks.json answers native preToolUse with Cursor's permission object, at exit 0. Allow is {"permission":"allow"}. Deny is {"permission":"deny","user_message","agent_message"}. preToolUse sets failClosed: true. A missing or empty pinned engine exits 2 and names pregate prepare. The command does not fall back to a global launcher or to pregate on PATH.

sessionStart stays in the file for the local IDE. Hosted cloud agents do not run sessionStart. They judge writes on preToolUse alone.

When both of those project files are present, the project Claude command exports PREGATE_PROJECT_HOOK=1. On a Cursor payload that hook exits 0 with no output when the native file owns the same event, and it records nothing. Pregate records one evaluation per tool_use_id. A global Claude registration does not set the marker and still evaluates.

Narrower pack matchers

Fifteen bundled rules reported shapes that were not the sink they name. The matchers now read the module specifier, the Supabase call, the JSX element, or the local binding, and a test.skip() inside a runtime if in a test is allowed. Packs: supabase 1.2.1, nextjs 1.4.1, react 1.2.1, testing 1.2.2. No rule was disabled or downgraded. The findings were measured on engine 0.0.8.

security-audit/SA-GO-SHELL-001 now reports exec.Command("sh", "-c", cmd) and exec.CommandContext when the script is a variable, including bash, /bin/sh, and /bin/bash. A script built with fmt.Sprintf or + stays reported. A constant script and a direct exec.Command("git", "status") stay quiet. The security-audit pack is 1.0.1. strings.Join, a shell name held in a variable, and a renamed os/exec import remain outside the check.

JS-EVAL-001 flags a bracket call of the string literal eval on window, such as window["eval"], and a later call of a local initialized to eval. Direct eval, window.eval, and (0, eval) stay flagged. A bracket call on any other object, the string eval outside a call, and a method named eval are not. The javascript pack is 1.2.2.

pregate scan recommends the Vue pack from dependencies, devDependencies, peerDependencies, and a .vue file in primary source. A server app often lists vue only as a devDependency. react in devDependencies recommends the React pack for the same reason. A devDependency still does not select Svelte, Next.js, Astro, Hono, Express, NestJS, or TanStack Query. vue-router and eslint-plugin-vue do not select Vue.

What this release does not establish

  • Launcher end-to-end tests cover the Cursor preToolUse payloads, the missing pinned engine, and the one-evaluation pair. Live cursor and cursor-agent 2026.11.11 sessions, hosted cloud runs, Windows Cursor sessions, and Cursor's trust prompt were not run in a live Cursor binary on the CI or development machine.
  • Another pty allocator, or an obfuscation the lexer does not read as a non-literal script, can still give a child a terminal. A terminal prints the approval code. The CI ratchet remains the boundary outside the machine.
  • A nested package owner outside packages/<name>/test/ still cannot be one include/exclude scope. The preview names it and changes nothing.
  • Advisor mode still blocks an unresolved import when an enforced static rule would have judged that file. Shadow and enforce still deny it.
  • The Go shell check does not follow strings.Join, a shell name held in a variable, or a renamed os/exec import.
  • No rule was disabled or downgraded. The macOS latency gate and the Windows archive pack timeout are unchanged. The macOS gate still fails by runner noise at times.
  • The full suite does not run on macOS in CI. macOS runs the latency and release-build jobs there, and the suite on the maintainer's machine.

The changelog lists every change. Guarantees and limits records the pty limit this release names.