Skip to content

feat: anti-bypass base-pinning, diff-aware regression gates, neutral entrypoint#13

Merged
renezander030 merged 1 commit into
masterfrom
feat/anti-bypass-regression-gate
Jul 3, 2026
Merged

feat: anti-bypass base-pinning, diff-aware regression gates, neutral entrypoint#13
renezander030 merged 1 commit into
masterfrom
feat/anti-bypass-regression-gate

Conversation

@renezander030

Copy link
Copy Markdown
Owner

Three enforcement gaps, mined from convergence across independent DoD tools (cogpin, donegate, god-mode-os, agent-guardrails) that all built anti-bypass mechanisms skillgate lacked.

What

  • Base-pinning + fail-closedcheck --pin / gate --pin read the spec from the git merge-base, not the working tree, so a change cannot loosen or delete the gate it is judged by. No resolvable base/spec => block, never a silent pass.
  • Diff-aware regression gatesno-new (a pattern's match count must not increase vs base: skips, eslint-disable, TODOs) and no-deleted (files present at base must still exist). Deterministic; fail closed without a base ref.
  • Neutral entrypointskillgate gate returns an allow/block decision for one command (raw or a hook JSON payload on stdin) so any harness (Cursor, Codex, git hook, shell) can enforce, not just Claude Code. Exit 0 allow / 2 block.

New/changed

  • New src/git.ts (read-only git plumbing + dependency-free glob matcher), test/antibypass.test.ts, test/e2e-antibypass.test.ts
  • src/core.ts, src/spec.ts, src/cli.ts, schema/done.schema.json

Verification

  • 58 tests pass (+19). Coverage 94% lines / 82% branches / 98% functions — above the repo's 85/70/90 DoD gate.
  • Smoke-tested against the built binary: an agent that strips a gate and adds a skip passes unpinned, is caught pinned.

…entrypoint

Three enforcement gaps, mined from convergence across cogpin/donegate/
god-mode-os/agent-guardrails (independent DoD tools that all built anti-bypass
mechanisms skillgate lacked).

- Base-pinning + fail-closed: `check --pin` / `gate --pin` read the spec from the
  git merge-base, not the working tree, so a change cannot loosen or delete the
  gate it is judged by. No resolvable base/spec => block, never silent pass.
- Diff-aware gates: `no-new` (a pattern's match count must not increase vs base)
  and `no-deleted` (files present at base must still exist). Deterministic; fail
  closed without a base ref.
- Neutral entrypoint: `skillgate gate` returns an allow/block decision for one
  command (raw or a hook JSON payload on stdin) so any harness (Cursor, Codex,
  git hook, shell) can enforce, not just Claude Code. Exit 0 allow / 2 block.

New src/git.ts (read-only git plumbing + dependency-free glob matcher).
+19 tests (58 total); coverage 94/82/98, above the 85/70/90 DoD gate.
@renezander030 renezander030 force-pushed the feat/anti-bypass-regression-gate branch from eefb422 to 6cc646f Compare July 3, 2026 14:33
@renezander030 renezander030 merged commit 34c57ad into master Jul 3, 2026
4 checks passed
@renezander030 renezander030 deleted the feat/anti-bypass-regression-gate branch July 3, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant