Repository navigation
0.16.1: a Devin target, pull-request base branches, here-document and dry-run matching, log recovery and more - #62
Merged
Merged
Conversation
A line that opens like a JSON object but does not parse is a truncated or
corrupt decision-log record. explain --commands now counts it as skipped
instead of replaying its JSON text as a shell command; --json reports the
count as skipped. Shell brace groups such as { git push; } still replay.
Diff-aware gates read the pull request's target branch from GITHUB_BASE_REF, CI_MERGE_REQUEST_TARGET_BRANCH_NAME or BITBUCKET_PR_DESTINATION_BRANCH instead of origin's default branch. A target that is not in the checkout fails closed.
A commit message or note written through a here-document no longer counts as a finish line because one of its lines names one. The body still counts when a shell may read it, and an unquoted body's command substitutions still count.
npm publish --dry-run, git push --dry-run, git push -n and other matched commands with --dry-run before -- are allowed while gates are unmet.
Diff-aware gates in a shallow clone without the fork point say the clone is shallow and how to fetch its history. The run still fails closed.
One best-effort git runner behind the git module's null-on-failure contract, the base-ref refusal rules next to the resolution order, and the here-document body reader outside the command splitter loop. The spec reference documents the here-document and dry-run matching rules.
A pull_request run sets GITHUB_BASE_REF (and GITHUB_HEAD_REF/GITHUB_REF_NAME); skillgate now judges a pull request against that target branch, so every throwaway fixture repo, which has neither branch, failed closed: PR #62, 41 of 275 tests on every OS, the coverage gate too. scripts/run-tests.mjs starts the tests without those variables (and SKILLGATE_BASE); a test keeps it that way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Session: claude:18a53163-916a-41e1-9aa7-a20e56ad87c1
…s either path separator; 0.16.1 says how to upgrade a shallow PR checkout PR #62 on 988c4c6: the dogfood 'skillgate check' in ci.yml's test job ran in a shallow checkout and failed closed (exit 2) under 0.16.1's new rule that a pull request is judged against its target branch; the test job now checks out with fetch-depth: 0, and contrib/github-action.yml does the same. The Devin doctor test expected '/' and Windows prints '.devin\hooks.v1.json'. The CHANGELOG entry carries an upgrade note and the README's CI section says what the checkout needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Session: claude:18a53163-916a-41e1-9aa7-a20e56ad87c1
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.
skillgate install devingates Devin Desktop (formerly Windsurf) and the Devin CLI with a fail-closedPreToolUsehook on theexecshell tool in.devin/hooks.v1.json, checked bydoctor devin.gatenow judges anexectool call as a shell command; before, it allowed one as an ungated tool.GITHUB_BASE_REF, GitLab'sCI_MERGE_REQUEST_TARGET_BRANCH_NAME, Bitbucket'sBITBUCKET_PR_DESTINATION_BRANCH) instead of origin's default branch. A request stacked on another branch could passno-fewerafter dropping test cases. A target missing from the checkout fails closed with a fetch hint;--baseandSKILLGATE_BASEstill win.skillgate logreads decision logs incrementally and skips malformed record shapes without losing valid neighboring decisions. Event names such as__proto__keep their own counters in JSON output.git commit -F- <<'EOF'or a note written withcat > notes.md <<EOFno longer counts as a push because one of its lines namesgit push. The body still counts when a shell may run it (bash <<EOF,cat <<EOF | sh,ssh host <<EOF), and the substitutions of an unquoted body still count.skillgate install <target> --follow-symlinkswrites through a symlinked agent configuration (a dotfiles.claude/settings.json, say) to the regular file it names and keeps the link. Without the flag a link is still refused, now with a hint. A dangling link or a link to a non-file is refused either way.skillgate explain --commands <log>skips a truncated or corrupt decision-log record instead of replaying its JSON text as a shell command, and reports how many lines it skipped (skippedin--json).npm publish --dry-run,git push --dry-run,git push -nand any matched command with--dry-runbefore--are allowed while gates are unmet.git commit -n(which skips hooks) andnpm run release -- --dry-runare still finish lines.fetch-depth: 0,GIT_DEPTH: 0,git fetch --unshallow) instead of calling the baseline unrelated or unreadable. The run still fails closed.absent,file-contains,no-new,no-fewer,commit-messages) match under the run deadline. A pattern that backtracks catastrophically fails its gate with a reason naming the file, where before it wedged the hook past its timeout.Two commits are tidy-ups with no behavior change. The sixth commit: one config writer for the symlink option, one scanner per
file-containsgate, a single non-global regex forno-new/no-fewer, one path lookup inwriteTextAtomic, a named list of tool-matcher targets, and decision-log corpus parsing next to the other log record rules. The last commit: one best-effort git runner behind the git module's null-on-failure contract, the base-ref refusal rules next to the resolution order, the here-document reader outside the command splitter loop, and the spec reference documenting the here-document and dry-run rules.Evidence
275 tests pass on Linux with each of Node 18, 20 and 22 (258 on master, plus 17 new regression tests). Clean installs, TypeScript builds, the self-check gates, encrypted-metrics help, Go tests and Go vet pass. Node 22 coverage: 95.66% lines, 87.56% branches, 98.26% functions.
mainhas one test case,developthree, and a branch stacked ondevelopdrops one, 0.16.0 withGITHUB_BASE_REF=developpassesno-fewer(2 ≥ 1, compared withmain). With this change the gate fails (base 3, now 2). A target branch missing from the checkout exits 2 with the fetch hint, and a push event (emptyGITHUB_BASE_REF) is judged as before.explainwithfinishLine: ["git push"]. 0.16.0 matches all nine. With this change the three that only carry text (a commit message, a note, a quoted substitution) no longer match, and the six a shell runs still do.PreToolUsepayloads piped togatewith one unmet gate. 0.16.0 blocks all five. With this change the three dry runs are allowed andnpm publishandgit push origin mainare still blocked with exit 2.git fetch --unshallowthe gate is judged normally.execpayload forgit push origin mainis allowed as "not a gated tool". With this change, afterinstall devin, the same payload is blocked with exit 2 while a gate is unmet and allowed once it passes.skillgate gate, with the last line truncated, givelog3 records + 1 malformed andexplain --commands3 commands + 1 skipped.install claude-codeon a project whose.claude/settings.jsonlinks to a dotfiles file exits with "refusing to replace a non-regular configuration". With--follow-symlinksthe hook lands in the linked file, the link and the file's 0640 mode are kept, and a rerun reports no change.absentgate with^(a+)+$over a 41-character line and a 2 s run timeout was still running after 20 s on 0.16.0. With this changecheckfails that gate after 2.5 s. Cost: about 0.35 ms more per scanned file.compat (windows, node 20)job covers it on this PR.Door
Two-way. Every change is additive, confined to a failure path, or narrows what counts as a finish line only where nothing can run (here-document text, dry runs). Bodies a shell may read, substitutions, and every other finish line stay gated. A pull request is judged against a different base only when CI names its target, and an unresolvable target fails closed. Symlinked configs are still refused unless the user passes the new flag. All of it reverts without a data migration. Log writing, receipts and the hook protocols are unchanged.
Blast radius
Sixteen files: core gate evaluation (pattern matching), command matching (here-documents, dry runs), Git base resolution (pull-request target, shallow-clone message), install and doctor (Devin target, symlink flag), the config file writer, the log reader, the CLI (
install,gatepayload parsing,log,explain --commands, base errors), four test files, README, spec reference, changelog, package manifest and lockfile version.install allnow also writes the Devin hook file.explain --jsongains one additive field,skipped. In CI, diff-aware gates of a pull request into a non-default branch now compare with that branch. Base ba1185d, eleven commits.