Skip to content

0.16.1: a Devin target, pull-request base branches, here-document and dry-run matching, log recovery and more - #62

Merged
renezander030 merged 13 commits into
masterfrom
release/v0.16.1
Nov 23, 2026
Merged

renezander030 merged 13 commits into
masterfrom
release/v0.16.1

Conversation

@renezander030

Copy link
Copy Markdown
Owner
  1. skillgate install devin gates Devin Desktop (formerly Windsurf) and the Devin CLI with a fail-closed PreToolUse hook on the exec shell tool in .devin/hooks.v1.json, checked by doctor devin. gate now judges an exec tool call as a shell command; before, it allowed one as an ungated tool.
  2. Diff-aware gates in a pull request are judged against the branch the request targets (GITHUB_BASE_REF, GitLab's CI_MERGE_REQUEST_TARGET_BRANCH_NAME, Bitbucket's BITBUCKET_PR_DESTINATION_BRANCH) instead of origin's default branch. A request stacked on another branch could pass no-fewer after dropping test cases. A target missing from the checkout fails closed with a fetch hint; --base and SKILLGATE_BASE still win.
  3. skillgate log reads 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.
  4. Finish-line matching reads a here-document body as data: a commit message passed with git commit -F- <<'EOF' or a note written with cat > notes.md <<EOF no longer counts as a push because one of its lines names git 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.
  5. skillgate install <target> --follow-symlinks writes 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.
  6. 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 (skipped in --json).
  7. A dry run is not a finish line: npm publish --dry-run, git push --dry-run, git push -n and any matched command with --dry-run before -- are allowed while gates are unmet. git commit -n (which skips hooks) and npm run release -- --dry-run are still finish lines.
  8. In a shallow clone whose history stops before the fork point, diff-aware gates say so and name the fetch that fixes it (fetch-depth: 0, GIT_DEPTH: 0, git fetch --unshallow) instead of calling the baseline unrelated or unreadable. The run still fails closed.
  9. Pattern gates (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-contains gate, a single non-global regex for no-new/no-fewer, one path lookup in writeTextAtomic, 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.

  • Each new test fails on the code before its commit and passes after it.
  • Pull-request base: in a repository where main has one test case, develop three, and a branch stacked on develop drops one, 0.16.0 with GITHUB_BASE_REF=develop passes no-fewer (2 ≥ 1, compared with main). 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 (empty GITHUB_BASE_REF) is judged as before.
  • Here-documents: nine commands through explain with finishLine: ["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.
  • Dry runs: five PreToolUse payloads piped to gate with one unmet gate. 0.16.0 blocks all five. With this change the three dry runs are allowed and npm publish and git push origin main are still blocked with exit 2.
  • Shallow clone: a depth-1 clone gives "refusing an unrelated or unreadable baseline" on 0.16.0, and with this change names the shallow clone and the fetch. After git fetch --unshallow the gate is judged normally.
  • Devin: with 0.16.0, a Devin exec payload for git push origin main is allowed as "not a gated tool". With this change, after install devin, the same payload is blocked with exit 2 while a gate is unmet and allowed once it passes.
  • Log streaming: a regression test reads a log larger than 64 MiB under a 64 MiB V8 heap budget. Four real decisions written by skillgate gate, with the last line truncated, give log 3 records + 1 malformed and explain --commands 3 commands + 1 skipped.
  • Symlinked config: with 0.16.0, install claude-code on a project whose .claude/settings.json links to a dotfiles file exits with "refusing to replace a non-regular configuration". With --follow-symlinks the hook lands in the linked file, the link and the file's 0640 mode are kept, and a rerun reports no change.
  • Pattern deadline: an absent gate 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 change check fails that gate after 2.5 s. Cost: about 0.35 ms more per scanned file.
  • Windows: not run locally. The CI 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, gate payload parsing, log, explain --commands, base errors), four test files, README, spec reference, changelog, package manifest and lockfile version. install all now also writes the Devin hook file. explain --json gains 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.

renezander030 and others added 13 commits November 23, 2026 13:55
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
@renezander030
renezander030 merged commit d09dd1b into master Nov 23, 2026
7 checks passed
@renezander030
renezander030 deleted the release/v0.16.1 branch November 23, 2026 17:52
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