Skip to content

Releases

v2.41.0

Choose a tag to compare

@komluk komluk released this 15 Nov 13:44
81f66f1

LSP entries no longer error on hosts that lack the language server binary.

Fixed

  • Claude Code printed Language server "plugin:scaffolding:<name>" couldn't start: its program "<bin>" wasn't found the first time a file of that type was touched on a machine without the language server installed (the 16 lspServers entries target the scaffolding.tool session containers, where each command is a shim on PATH).
    Every lspServers entry now runs node ${CLAUDE_PLUGIN_ROOT}/lsp/launch.js <program> [args...]. When <program> is on PATH the launcher runs it unchanged (stdio inherited, SIGTERM/SIGINT forwarded, exit status propagated).
    When it is not, the launcher answers as a no-op LSP server: initialize gets empty capabilities with serverInfo.name " (not installed)", shutdown gets null, any other request gets -32601, notifications are ignored, and it exits 0 on exit or stdin EOF. Only protocol messages go to stdout; one line goes to stderr.
  • hooks/lib/refactor-guard.mjs looks through the launcher: an lspServers entry whose command is node ${CLAUDE_PLUGIN_ROOT}/lsp/launch.js <program> counts as covering its extensions only when <program> is on PATH, as before (otherwise node would always be found and the guard would wrongly treat the language as covered).

Added

  • lsp/launch.js (Node >= 22, no dependencies) and tests/hooks/test-lsp-launcher.sh (+ lsp-client.mjs): missing-program handshake, present-program args/stdio/exit code/SIGTERM, and a check that every lspServers entry routes through the launcher.

v2.39.0

Choose a tag to compare

@github-actions github-actions released this 08 Nov 22:59
ba49682

Last step of removing Python from the plugin: memory-recall, the Copilot tooling and the test scripts now run on Node, the remaining
Python snippets in commands and skills are gone, and CI fails if Python comes back. The repo has no .py file and no python3
invocation outside tests/hooks/parity/ (record-time only, see below). Node >= 22 is now the only runtime the plugin needs (plus bash, timeout, git).

Changed

  • hooks/memory-recall.sh is a shim over hooks/lib/memory-recall.mjs (plus ipclass.mjs, pyurl.mjs; pyurl.mjs is the urlsplit port that
    action-log/targets.mjs already had, moved to hooks/lib/ and shared). Same prompt filter, URL and host checks, request bytes, response
    parsing and output. Without node the hook prints scaffolding: node not found, memory-recall not enforced on stderr and exits 0.
    • Plain http is still allowed only when every address the host resolves to is loopback or private, using python 3.14's exact ipaddress
      tables (ipclass.mjs: 192.0.2.0/24, 198.18.0.0/15, 240.0.0.0/4 ... count as private, 100.64.0.0/10 (Tailscale / CGNAT) does not).
    • Redirects are never followed. The proxy environment is ignored (agent: false; it also holds with NODE_USE_ENV_PROXY=1). Certificate checks stay on
      (NODE_TLS_REJECT_UNAUTHORIZED=0 has no effect) and trust the system store, like python/OpenSSL did. The timeout is per socket operation, as before.
  • Copilot tooling: copilot/scaffolding-{hook-merge,skills-merge,transform}.py became .mjs (+ scaffolding-json.mjs, a small python-compatible JSON reader/writer
    so a user's settings.json keeps its key order, integers and floats); scaffolding-sync.sh calls node, scaffolding-plugin-root.sh and
    hooks/pre-commit-validation-copilot.sh.tmpl no longer need jq. install.sh deletes the old ~/.copilot/scaffolding-*.py.
    After upgrading run ~/.copilot/scaffolding-sync.sh again (or bash <plugin>/copilot/install.sh).
  • tests/scripts/sync-secret-patterns.py became .mjs (--check output is byte-equal with the vendored file).
  • tests/hooks/test-memory-recall.sh uses Node fixture servers (tests/hooks/fixtures/http-srv.mjs, redirect-srv.mjs) instead of python ones.
  • /doctor checks for node >= 22 and reads JSON with node; /memory enable, /sofa, sofa-search, /specs:run|ff|new|onboard and spec-workflow no longer call python3.
    The eval "$(python3 ...)" in /sofa and sofa-search is gone: values are returned NUL-delimited and read with read -d '', so no shell parses a credential or a session id.
  • skills/ui-ux-pro-max: removed the sections that ran scripts/search.py (the scripts were never shipped); the rules, quick reference, common mistakes and checklist stay.
  • CI (validate.yml): the frontmatter / workflows/*.yaml lint runs tests/scripts/lint-yaml.mjs with a pinned yaml package installed into a temp dir (no setup-python, no PyYAML);
    new no-python job runs tests/scripts/no-python-guard.sh (fails on a tracked .py / .pyc / .pyi, a __pycache__, a python/python3 command, a python process spawned from
    node, setup-python, pip install, PyYAML; comment lines are ignored; scanned: hooks, tests, scripts, validators, copilot, .github, commands, sofa-search, spec-workflow, ui-ux-pro-max).
    Exceptions are listed with a reason in .github/no-python-allowlist (one: tests/hooks/parity/, which needs the original python to record goldens and run the differential fuzz;
    a stale entry fails the guard). node --check now also covers copilot/*.mjs, tests/hooks/*.mjs and tests/scripts/*.mjs.

Tests

  • tests/hooks/parity: 423 memory-recall cases recorded from the python hook (v2.38.0) against a fixture HTTP server (the runner got a server: case option; the request the server saw is part of the golden)
    and 125 cases for the two Copilot settings mergers. Differential fuzz fuzz-memory-recall.mjs: 1500 inputs, 0 differences. ipclass.mjs agrees with ipaddress on 244 boundary addresses.
  • New test-copilot.sh (transform, plugin-root resolver, sync / uninstall / install, the wrapper without jq) and test-no-python.sh (the guard catches what it should).

Differences from the Python implementation

  • scaffolding-transform: the frontmatter is rewritten line by line, so description and skills keep the source formatting instead of the yaml.safe_dump re-wrapping (parsed values are identical for all six agents; body byte-identical).
  • Python error output of the settings mergers (a traceback) is now one line scaffolding-<tool>: <message>; exit code (1) and "nothing written" are unchanged.
  • memory-recall: an idle-timeout shorter than ~10 ms races the connect in both implementations and is not compared.

v2.38.0

Choose a tag to compare

@github-actions github-actions released this 08 Nov 19:01
ff82928

Third step of removing Python from the plugin runtime: the episodic action log now runs on Node.

Changed

  • hooks/lib/action_log.py and hooks/lib/action_log_lib/*.py are replaced by hooks/lib/action-log.mjs plus hooks/lib/action-log/{extract,records,redact,render,targets,py,argparse,usage,limits}.mjs
    (plain ESM, node: built-ins only, Node >= 22). hooks/action-log.sh no longer calls python3; without node it does nothing and prints
    scaffolding: node not found, action-log not enforced on stderr (exit 0). tests/hooks/action_log_fixtures.py became tests/hooks/action-log-fixtures.mjs (byte-identical output).
  • Same CLI contract as before: platform --task-dir D --conv-dir D [--force] [--agent A], local ..., render --conv-dir D, backfill ROOT; same stdout
    (render prints the timeline path, then calls=N errors=E), exit code always 0, fail-open warnings on stderr. Same log format, paths, O_APPEND single-line
    writes, umask 002, caps (5000 records / 2 MB per run), rotation (gzip beyond 50 MB per conversation), and redaction. Locked in by 175 golden cases recorded from the Python
    original (tests/hooks/parity/cases/action-log.mjs: platform / local / render / backfill / argparse usage and the Stop / SessionEnd shim) and by a differential fuzz against it
    (tests/hooks/parity/fuzz-action-log.mjs --old <checkout of 2.37.0>/hooks).
  • Redaction: python and JS regexes differ (\w / \b / \d / \s are Unicode in python, (?i) also folds İ ı ſ K, atomic groups). The generic rules are rebuilt with the python meaning; the vendored
    secret-patterns.json patterns are converted at load time (pyRegex: Unicode classes, (?>...) atomic group of IBAN_SPACED -> lookahead + backreference). A test asserts that all 25 compile,
    so a pattern can no longer be skipped silently.
  • Backend (scaffolding.tool) must switch with this version: app/backend-node/src/execution/actionLog.ts has to spawn
    process.execPath with [<plugin>/hooks/lib/action-log.mjs, platform|render, ...] instead of python3 -I <plugin>/hooks/lib/action_log.py ... (same arguments, stdin, stdout, exit codes).
    Pin the backend to plugin >= 2.38.0 in the same change; an old backend with this plugin simply produces no action log (fail-open).

Differences from the Python implementation

  • Rotated .jsonl.gz files hold the same content but different deflate bytes (zlib version), and carry no file name in the gzip header.
  • Code points that exist only in Unicode 17 (Node 24) and not in 16 (CPython 3.14) count as word characters in redaction.
  • Warning text on stderr (action-log: <cmd> failed: ...) quotes the JS exception message instead of the Python one.

v2.37.0

Choose a tag to compare

@github-actions github-actions released this 07 Nov 22:40
0a18f90

Security

  • Blocking hooks rewritten on a shell splitter (hooks/lib/shell-words.mjs + hooks/lib/guards.mjs, new hook-io.mjs guard env|rm|push,
    replacing rm-target). The hooks now see every line of a multi-line command, quoting, \rm / /bin/rm, sudo / env / command /
    timeout wrappers, bash -c / sh -c, $(...) and xargs.

  • Matchers fixed. Bash(rm *) and Bash(git push*) are not tool-name matchers, so block-destructive-rm and block-force-push
    are now registered on Bash, and block-env-write on Edit|Write|Bash. Each has a bash fast path, so node only starts when the
    input mentions env / push / rm|unlink|shred|truncate|-delete or has a quote/backslash. plugin.json and settings.json agree.

  • block-env-write: case-insensitive .env / .env.* (.env.example stays denied); basename computed in Node (a -.env / --
    path no longer crashes basename); Bash >, >>, >|, &>, 2> to any .env path, quoted or not; tee (any flags/position);
    cp / mv / install destinations (-t included); sed -i / --in-place; perl -i.

  • block-destructive-rm: also protects /*, ~, $HOME, ${HOME} and every top-level entry of $HOME, /home, /root, /boot,
    /opt, /srv, /bin, /sbin, /lib*, ./, ../.. (any depth) and .git. Paths are normalised (//, /etc/.., /./, quotes).
    Also blocks find <protected> -delete / -exec rm and xargs sh -c 'rm ...'. rm -rf node_modules, ./dist, ~/proj/build stay allowed.

  • block-force-push: also blocks +refspec, --mirror, --delete / -d / :branch on main / master, and pushes through
    git -c x, git -C dir and --no-pager. Quoted text (git commit -m "... git push --force"), git pushd and -f on another
    command or after -- are no longer false positives.

  • block-subagent: general-purpose is denied in any case (General-Purpose). explore stays an exact match, and scaffolding:* /
    plan stay allowed.

  • post-edit-format passes a --prefixed relative path as ./-x (ruff, black, prettier, dotnet); file-size-warn uses grep -- "$FILE_PATH".

  • Fail closed when the command cannot be fully parsed (review H1).

    • $(...) matching is quote-aware, and arithmetic ($((..)), $[..], ((..)), let) is not treated as a heredoc.
    • The parse counts as incomplete on an unterminated quote, $(, heredoc or $[, on nesting deeper than 6, on more than 12 wrappers, or on
      input over 256 KB. When it is incomplete, a guard denies if the raw text mentions its danger words.
    • The .sh hooks deny when node exits non-zero after the fast path matched.
    • The wrapper loop is index-based: 240 KB of do keywords takes under 3 s, down from about 19 s.
  • block-subagent: no bash-4 ${var,,} (macOS bash 3.2); nocasematch + case.

  • block-force-push: abbreviated long options (--de, --mir, --forc), and git -c alias.*, remote.*.push=, remote.*.mirror=,
    help.autocorrect=.

  • block-env-write: <>; glob and brace words that could name a .env file (.e?v, .[e]nv, .en*, .{env,bak}); truncate, ln,
    curl -o/--output, wget -O and dd of= destinations; matcher adds MultiEdit.

  • block-destructive-rm:

    • Recursive alone is enough (rm -r /); long-option prefixes (--rec); brace and glob targets (/{etc,tmp}, /e{t,x}c);
      the macOS /Users, /Applications, /System, /Library, /private/etc, /private/var.
    • No longer protected: /var/folders, /private/var/folders, /var/tmp and /usr/local, all below.
    • .git is protected only as ./.git or the repo's top-level .git, resolved from the hook cwd. Nested vendor/x/.git is allowed.
    • In $HOME, only the dir itself and .ssh, .gnupg, .config, .local, .claude are protected; ~/.cache/x and ~/tmp/x are allowed.
    • Relative paths are resolved against cwd.
  • Splitter (review M4/M5):

    • Empty $() / backticks and $@ / $* inside a word are removed; unquoted words are brace-expanded; glob program names (/bin/r?)
      match.
    • Recurses into env -S, here-strings (bash <<<), su -c, script -c, flock [-c], watch, function f {..} and coproc.
    • New wrappers: chroot, strace, ltrace, taskset.
    • find start paths skip -H, -L, -P, -D x and -O<n>; $'\U........'.
    • Fast-path triggers add `, $, *, ?, [ and {.

Changed

  • Parity goldens of the four block-* hooks re-recorded from the Node hooks: 106 intended decision changes against the python
    goldens (env-write 33, destructive-rm 46, force-push 24, subagent 3).
    • Now denied: every case named "(not caught)", "(allowed)" or "not protected"; plus rm -r / and rm -RF / (recursive is enough),
      rm -rf .* (a glob that can name ../.git) and dd of=.env.
    • Now allowed (old false positives):
      • force-push: quoted text, git pushd, and -f on another command or after --. A JSON list/object command, and a CRLF case,
        also flip to allowed.
      • destructive-rm: echo -rf; rm /etc, rm -r\n-f / and rm -rf\n/etc. A newline ends the command, so rm has no flags or target.
      • destructive-rm: rm -rf /usr/local/my\ dir, because /usr/local is no longer protected.
  • tests/hooks/test-block-bypass.sh (new): every repro from the security review (H1, M1-M8) and the listed false positives.
  • tests/hooks/test-block-hooks.sh: the old "only the last line is inspected" and "rm -rf ./ is allowed" assertions now assert the fix.

v2.36.0

Choose a tag to compare

@github-actions github-actions released this 07 Nov 18:49
7367fe5

Second step of removing Python from the plugin runtime: refactor-guard now runs on Node.

Changed

  • hooks/lib/refactor_guard.py is replaced by hooks/lib/refactor-guard.mjs (plain ESM, node: built-ins only, Node >= 22) plus hooks/lib/pystd.mjs,
    a port of the Python stdlib behaviour the hook depended on (shlex.split, glob.glob + fnmatch, os.path.*, shutil.which, str.splitlines,
    text-mode reads, python \w / \s). hooks/refactor-guard.sh no longer calls python3; it keeps the bash prefilter, so a Bash call that mentions
    neither sed nor perl never starts node. When node is missing it fails open (exit 0) with scaffolding: node not found, refactor-guard not enforced on stderr.
  • Same decisions, messages and exit codes as 2.34.0 (byte for byte), including the fixes of 2.31.1: xargs / $(...) renames (grep workspace scan, 300 ms budget),
    failed LSP calls are not evidence, and <session>/subagents/*.jsonl is searched too. Locked in by 472 golden cases recorded from the Python original
    (tests/hooks/parity/cases/refactor-guard.mjs: Edit/MultiEdit/Write on definitions in every supported language, sed / perl / xargs / $(...) renames,
    LSP and graphify evidence in the main and the subagent transcript, failed and successful calls, deny / warn / off, LSP coverage), and by a differential fuzz (9100 inputs over 7 runs, 0 differences; 3000 of them on the final code)
    against the Python hook (tests/hooks/parity/fuzz-refactor-guard.mjs, run with --old <checkout of 2.34.0>/hooks).
  • Latency on a 2.2 MB / 14k-line transcript: ~155 ms (Python ~105 ms); no transcript ~39 ms (Python ~34 ms); Bash without sed/perl ~4 ms (unchanged).

Known gaps (ported as is; separate issues)

  1. A failed LSP call is detected from text: is_error, a leading Error, connection got disposed, server is running. A list-form result
    ([{"type": "text", "text": "Error: ..."}]) is serialised the way Python's json.dumps does, with ", " and ": ", so the compact-form Error pattern
    never matches it: only is_error or the two phrases flag it, and a list-form Error: ... result still counts as evidence.
  2. If the workspace scan (grep -rlE, 300 ms budget) times out or grep is missing, the check is skipped (fail open).
  3. Subagent evidence: only the 8 newest subagents/*.jsonl, and only the last 2 MB of each transcript.
  4. Renames done with tools other than sed -i / perl -pi (awk -i inplace, ed, python -c, git mv + edits) are not detected.
  5. The scan needs grep (GNU/BSD with -r -l -E -I --include --exclude-dir) on PATH.

Differences from the Python hook

  • When one sed renames several symbols defined in the same file, Python listed them in hash-randomised set order (it changed between runs); the port
    lists them in code point order. Same symbols, same decision.

v2.35.0

Choose a tag to compare

@github-actions github-actions released this 07 Nov 14:24
a52d074

First step of removing Python from the plugin runtime (plan: Node >= 22 + bash only).

Changed

  • 16 hooks no longer call python3: block-subagent, block-force-push, block-destructive-rm, block-env-write, file-size-warn,
    file-staleness-check, file-staleness-update, post-edit-format, worktree-create, worktree-remove, completion-nudge,
    memory-ingest, memory-ingest-mark, auto-init-check, memory-project-id, refresh-mcp-token.
    JSON handling moved to hooks/lib/hook-io.mjs and hooks/lib/staleness.mjs (plain ESM, node: built-ins only, no npm, no package.json).
    The .sh entry points, their paths, registrations and the grep/case logic stay as they were; at most one node process runs per hook call
    (block-destructive-rm and worktree-create went from two Python processes to one).
  • Behaviour is byte-identical: same exit codes, stdout and stderr (including json.dumps separators and \uXXXX escaping, Python str.split() /
    truthiness / print() quirks, surrogateescape on invalid UTF-8). Locked in by 668 golden cases recorded from the Python implementation before the port.
  • New runtime requirement: Node >= 22 on the machine that runs the hooks. When node is missing these hooks fail open as before (exit 0) and print
    scaffolding: node not found, <hook> not enforced on stderr (worktree-create exits 1 with a message, as it did for missing input).
  • file-staleness-* read the mtime with fs instead of stat -c %Y, so they also work on macOS. The store format (/tmp/scaffolding-mtime-<task>.json,
    string seconds) is unchanged and still shared with the backend.

Added

  • tests/hooks/parity/ + tests/hooks/test-parity.sh: golden-output parity runner (exit code, stdout, stderr and resulting files, no python3 on PATH).
  • Tests for hooks that had none: test-block-hooks.sh, test-file-hooks.sh, test-stop-hooks.sh (completion-nudge, memory-ingest, refresh-mcp-token),
    test-hook-io.sh.
  • CI job hook-tests (setup-node 24, bash tests/run-all.sh, node --check on hooks/lib/*.mjs).

Removed

  • 7 tracked .pyc files under hooks/lib/**/__pycache__/; .gitignore now ignores __pycache__/ and *.pyc.

Not changed (later steps)

  • refactor-guard, action-log, memory-recall and the Copilot scripts still use Python.

v2.34.0

Choose a tag to compare

@github-actions github-actions released this 06 Nov 22:19
585f6d9

Added

  • scripts/worktree-gc.sh + /worktree-gc command: removes worktrees and local branches whose work is already in origin/<default>
    (no commits ahead, patch-equivalent via git cherry, or squash-merged: remote ref gone and every commit subject, trailing (#N) stripped, in origin/<default>).
    Dry run by default; --apply removes, --all-repos <dir> scans each repo under <dir>. Keeps anything with uncommitted tracked changes, the main checkout, and anything unsure. Never deletes remote branches.
    Tests: tests/hooks/test-worktree-gc.sh.

Changed

  • agents/gitops.md, skills/git-operations, skills/worktree-management: worktree + local branch cleanup is now a MANDATORY final step of every merge
    (refuse on uncommitted tracked changes and report it; cleanup result must appear in the final report).

v2.32.5

Choose a tag to compare

@komluk komluk released this 29 Oct 10:28
395dbbc

Added

  • Per-repo opt-out for hooks/pre-commit-validation.sh: git config scaffolding.precommitValidation false (local config, nothing committed) prints
    [skip] local validation disabled for this repo (git config scaffolding.precommitValidation=false) and exits 0. Unset or any other value keeps validation on.
  • copilot/: versioned Copilot CLI sync tooling (scaffolding-sync.sh and helpers, hook wrapper template) plus copilot/install.sh for one-step setup.

Fixed

  • Copilot hook wrapper validated the session cwd instead of the repo the commit targets (git -C, cd X &&, payload cwd).

v2.32.4

Choose a tag to compare

@komluk komluk released this 29 Oct 10:08
f7e51b2

Changed

  • hooks/pre-commit-validation.sh skips validation when every staged path (deletions included) is under .github/ or .gitea/,
    printing [skip] only .github/.gitea changes staged -- skipping validation. Any other staged path, including docs and generic yml, is validated as before.
    Motivation: a commit that only deleted upstream .github/workflows in a fork was blocked by a full npm test that failed for local-environment reasons.
    New test: tests/hooks/test-pre-commit-validation.sh. (#48)

v2.32.3

Choose a tag to compare

@github-actions github-actions released this 28 Oct 12:46
7934941

Changed

  • "Code exploration" rule in the six analysis agents (analyst, architect, debugger, developer, optimizer, reviewer), identical in all six.
    • Graph: skip graph_stats / god_nodes when a "Project code graph" block is already in the prompt.
    • LSP: for callers/references in typed code, locate the definition once (graph get_node, LSP workspaceSymbol or one grep), then use incomingCalls / findReferences; never grep for "X(" call sites. Untyped JavaScript (no checkJs) is the exception: use rg -n.
    • grep/sed/cat via Bash only for literal text and line ranges; explicitly overrides generic "search with grep/find" guidance.
    • Motivation: on the scaffolding.tool platform the architect answered "who calls X" in a TypeScript repo with 7 Bash greps and 0 LSP/graph calls although both were available.
    • LSP and the graph are optional (no binary on PATH, no server for the language; graphify MCP is not shipped by the plugin): rule 2 now falls back to rg -n / grep and the agent says LSP was unavailable.
    • Prompts only, no hook or code change.
⌂ 换网址