feat: anti-bypass base-pinning, diff-aware regression gates, neutral entrypoint#13
Merged
Merged
Conversation
…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.
eefb422 to
6cc646f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
check --pin/gate --pinread 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.no-new(a pattern's match count must not increase vs base: skips, eslint-disable, TODOs) andno-deleted(files present at base must still exist). Deterministic; fail closed without a base ref.skillgate gatereturns 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
src/git.ts(read-only git plumbing + dependency-free glob matcher),test/antibypass.test.ts,test/e2e-antibypass.test.tssrc/core.ts,src/spec.ts,src/cli.ts,schema/done.schema.jsonVerification