Repository navigation
Releases
v2.41.0
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 foundthe first time a file of that type was touched on a machine without the language server installed (the 16lspServersentries target the scaffolding.tool session containers, where each command is a shim on PATH).
EverylspServersentry now runsnode ${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:initializegets empty capabilities withserverInfo.name" (not installed)",shutdowngetsnull, any other request gets-32601, notifications are ignored, and it exits 0 onexitor stdin EOF. Only protocol messages go to stdout; one line goes to stderr. hooks/lib/refactor-guard.mjslooks through the launcher: anlspServersentry whose command isnode ${CLAUDE_PLUGIN_ROOT}/lsp/launch.js <program>counts as covering its extensions only when<program>is on PATH, as before (otherwisenodewould always be found and the guard would wrongly treat the language as covered).
Added
lsp/launch.js(Node >= 22, no dependencies) andtests/hooks/test-lsp-launcher.sh(+lsp-client.mjs): missing-program handshake, present-program args/stdio/exit code/SIGTERM, and a check that everylspServersentry routes through the launcher.
v2.39.0
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.shis a shim overhooks/lib/memory-recall.mjs(plusipclass.mjs,pyurl.mjs;pyurl.mjsis theurlsplitport that
action-log/targets.mjsalready had, moved tohooks/lib/and shared). Same prompt filter, URL and host checks, request bytes, response
parsing and output. Withoutnodethe hook printsscaffolding: node not found, memory-recall not enforcedon stderr and exits 0.- Plain
httpis still allowed only when every address the host resolves to is loopback or private, using python 3.14's exactipaddress
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 withNODE_USE_ENV_PROXY=1). Certificate checks stay on
(NODE_TLS_REJECT_UNAUTHORIZED=0has no effect) and trust the system store, like python/OpenSSL did. The timeout is per socket operation, as before.
- Plain
- Copilot tooling:
copilot/scaffolding-{hook-merge,skills-merge,transform}.pybecame.mjs(+scaffolding-json.mjs, a small python-compatible JSON reader/writer
so a user'ssettings.jsonkeeps its key order, integers and floats);scaffolding-sync.shcallsnode,scaffolding-plugin-root.shand
hooks/pre-commit-validation-copilot.sh.tmplno longer needjq.install.shdeletes the old~/.copilot/scaffolding-*.py.
After upgrading run~/.copilot/scaffolding-sync.shagain (orbash <plugin>/copilot/install.sh). tests/scripts/sync-secret-patterns.pybecame.mjs(--checkoutput is byte-equal with the vendored file).tests/hooks/test-memory-recall.shuses Node fixture servers (tests/hooks/fixtures/http-srv.mjs,redirect-srv.mjs) instead of python ones./doctorchecks fornode>= 22 and reads JSON with node;/memory enable,/sofa,sofa-search,/specs:run|ff|new|onboardandspec-workflowno longer callpython3.
Theeval "$(python3 ...)"in/sofaandsofa-searchis gone: values are returned NUL-delimited and read withread -d '', so no shell parses a credential or a session id.skills/ui-ux-pro-max: removed the sections that ranscripts/search.py(the scripts were never shipped); the rules, quick reference, common mistakes and checklist stay.- CI (
validate.yml): the frontmatter /workflows/*.yamllint runstests/scripts/lint-yaml.mjswith a pinnedyamlpackage installed into a temp dir (nosetup-python, no PyYAML);
newno-pythonjob runstests/scripts/no-python-guard.sh(fails on a tracked.py/.pyc/.pyi, a__pycache__, apython/python3command, 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 --checknow also coverscopilot/*.mjs,tests/hooks/*.mjsandtests/scripts/*.mjs.
Tests
tests/hooks/parity: 423memory-recallcases recorded from the python hook (v2.38.0) against a fixture HTTP server (the runner got aserver:case option; the request the server saw is part of the golden)
and 125 cases for the two Copilot settings mergers. Differential fuzzfuzz-memory-recall.mjs: 1500 inputs, 0 differences.ipclass.mjsagrees withipaddresson 244 boundary addresses.- New
test-copilot.sh(transform, plugin-root resolver, sync / uninstall / install, the wrapper withoutjq) andtest-no-python.sh(the guard catches what it should).
Differences from the Python implementation
scaffolding-transform: the frontmatter is rewritten line by line, sodescriptionandskillskeep the source formatting instead of theyaml.safe_dumpre-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
Third step of removing Python from the plugin runtime: the episodic action log now runs on Node.
Changed
hooks/lib/action_log.pyandhooks/lib/action_log_lib/*.pyare replaced byhooks/lib/action-log.mjsplushooks/lib/action-log/{extract,records,redact,render,targets,py,argparse,usage,limits}.mjs
(plain ESM,node:built-ins only, Node >= 22).hooks/action-log.shno longer callspython3; withoutnodeit does nothing and prints
scaffolding: node not found, action-log not enforcedon stderr (exit 0).tests/hooks/action_log_fixtures.pybecametests/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
(renderprints the timeline path, thencalls=N errors=E), exit code always 0, fail-open warnings on stderr. Same log format, paths,O_APPENDsingle-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/\sare Unicode in python,(?i)also foldsİ ı ſ K, atomic groups). The generic rules are rebuilt with the python meaning; the vendored
secret-patterns.jsonpatterns are converted at load time (pyRegex: Unicode classes,(?>...)atomic group ofIBAN_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.tshas to spawn
process.execPathwith[<plugin>/hooks/lib/action-log.mjs, platform|render, ...]instead ofpython3 -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.gzfiles 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
Security
-
Blocking hooks rewritten on a shell splitter (
hooks/lib/shell-words.mjs+hooks/lib/guards.mjs, newhook-io.mjs guard env|rm|push,
replacingrm-target). The hooks now see every line of a multi-line command, quoting,\rm//bin/rm,sudo/env/command/
timeoutwrappers,bash -c/sh -c,$(...)andxargs. -
Matchers fixed.
Bash(rm *)andBash(git push*)are not tool-name matchers, soblock-destructive-rmandblock-force-push
are now registered onBash, andblock-env-writeonEdit|Write|Bash. Each has a bash fast path, sonodeonly starts when the
input mentionsenv/push/rm|unlink|shred|truncate|-deleteor has a quote/backslash.plugin.jsonandsettings.jsonagree. -
block-env-write: case-insensitive.env/.env.*(.env.examplestays denied); basename computed in Node (a-.env/--
path no longer crashesbasename); Bash>,>>,>|,&>,2>to any.envpath, quoted or not;tee(any flags/position);
cp/mv/installdestinations (-tincluded);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 blocksfind <protected> -delete/-exec rmandxargs sh -c 'rm ...'.rm -rf node_modules,./dist,~/proj/buildstay allowed. -
block-force-push: also blocks+refspec,--mirror,--delete/-d/:branchonmain/master, and pushes through
git -c x,git -C dirand--no-pager. Quoted text (git commit -m "... git push --force"),git pushdand-fon another
command or after--are no longer false positives. -
block-subagent:general-purposeis denied in any case (General-Purpose).explorestays an exact match, andscaffolding:*/
planstay allowed. -
post-edit-formatpasses a--prefixed relative path as./-x(ruff, black, prettier, dotnet);file-size-warnusesgrep -- "$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
.shhooks deny whennodeexits non-zero after the fast path matched. - The wrapper loop is index-based: 240 KB of
dokeywords 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), andgit -c alias.*,remote.*.push=,remote.*.mirror=,
help.autocorrect=. -
block-env-write:<>; glob and brace words that could name a.envfile (.e?v,.[e]nv,.en*,.{env,bak});truncate,ln,
curl -o/--output,wget -Oanddd of=destinations; matcher addsMultiEdit. -
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/tmpand/usr/local, all below. .gitis protected only as./.gitor the repo's top-level.git, resolved from the hookcwd. Nestedvendor/x/.gitis allowed.- In
$HOME, only the dir itself and.ssh,.gnupg,.config,.local,.claudeare protected;~/.cache/xand~/tmp/xare allowed. - Relative paths are resolved against
cwd.
- Recursive alone is enough (
-
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 {..}andcoproc. - New wrappers:
chroot,strace,ltrace,taskset. findstart paths skip-H,-L,-P,-D xand-O<n>;$'\U........'.- Fast-path triggers add
`,$,*,?,[and{.
- Empty
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 /andrm -RF /(recursive is enough),
rm -rf .*(a glob that can name../.git) anddd of=.env. - Now allowed (old false positives):
- force-push: quoted text,
git pushd, and-fon another command or after--. A JSON list/objectcommand, and a CRLF case,
also flip to allowed. - destructive-rm:
echo -rf; rm /etc,rm -r\n-f /andrm -rf\n/etc. A newline ends the command, sormhas no flags or target. - destructive-rm:
rm -rf /usr/local/my\ dir, because/usr/localis no longer protected.
- force-push: quoted text,
- Now denied: every case named "(not caught)", "(allowed)" or "not protected"; plus
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
Second step of removing Python from the plugin runtime: refactor-guard now runs on Node.
Changed
hooks/lib/refactor_guard.pyis replaced byhooks/lib/refactor-guard.mjs(plain ESM,node:built-ins only, Node >= 22) plushooks/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.shno longer callspython3; it keeps the bash prefilter, so a Bash call that mentions
neithersednorperlnever starts node. Whennodeis missing it fails open (exit 0) withscaffolding: node not found, refactor-guard not enforcedon stderr.- Same decisions, messages and exit codes as 2.34.0 (byte for byte), including the fixes of 2.31.1:
xargs/$(...)renames (grepworkspace scan, 300 ms budget),
failed LSP calls are not evidence, and<session>/subagents/*.jsonlis 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)
- A failed LSP call is detected from text:
is_error, a leadingError,connection got disposed,server is running. A list-form result
([{"type": "text", "text": "Error: ..."}]) is serialised the way Python'sjson.dumpsdoes, with", "and": ", so the compact-formErrorpattern
never matches it: onlyis_erroror the two phrases flag it, and a list-formError: ...result still counts as evidence. - If the workspace scan (
grep -rlE, 300 ms budget) times out orgrepis missing, the check is skipped (fail open). - Subagent evidence: only the 8 newest
subagents/*.jsonl, and only the last 2 MB of each transcript. - Renames done with tools other than
sed -i/perl -pi(awk -i inplace,ed,python -c,git mv+ edits) are not detected. - The scan needs
grep(GNU/BSD with-r -l -E -I --include --exclude-dir) onPATH.
Differences from the Python hook
- When one
sedrenames several symbols defined in the same file, Python listed them in hash-randomisedsetorder (it changed between runs); the port
lists them in code point order. Same symbols, same decision.
v2.35.0
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 tohooks/lib/hook-io.mjsandhooks/lib/staleness.mjs(plain ESM,node:built-ins only, no npm, nopackage.json).
The.shentry points, their paths, registrations and the grep/case logic stay as they were; at most onenodeprocess runs per hook call
(block-destructive-rmandworktree-createwent from two Python processes to one). - Behaviour is byte-identical: same exit codes, stdout and stderr (including
json.dumpsseparators and\uXXXXescaping, Pythonstr.split()/
truthiness /print()quirks,surrogateescapeon 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
nodeis missing these hooks fail open as before (exit 0) and print
scaffolding: node not found, <hook> not enforcedon stderr (worktree-createexits 1 with a message, as it did for missing input). file-staleness-*read the mtime withfsinstead ofstat -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, nopython3on 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 --checkonhooks/lib/*.mjs).
Removed
- 7 tracked
.pycfiles underhooks/lib/**/__pycache__/;.gitignorenow ignores__pycache__/and*.pyc.
Not changed (later steps)
refactor-guard,action-log,memory-recalland the Copilot scripts still use Python.
v2.34.0
Added
scripts/worktree-gc.sh+/worktree-gccommand: removes worktrees and local branches whose work is already inorigin/<default>
(no commits ahead, patch-equivalent viagit cherry, or squash-merged: remote ref gone and every commit subject, trailing(#N)stripped, inorigin/<default>).
Dry run by default;--applyremoves,--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
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.shand helpers, hook wrapper template) pluscopilot/install.shfor 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
Changed
hooks/pre-commit-validation.shskips 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/workflowsin a fork was blocked by a fullnpm testthat failed for local-environment reasons.
New test:tests/hooks/test-pre-commit-validation.sh. (#48)
v2.32.3
Changed
- "Code exploration" rule in the six analysis agents (analyst, architect, debugger, developer, optimizer, reviewer), identical in all six.
- Graph: skip
graph_stats/god_nodeswhen a "Project code graph" block is already in the prompt. - LSP: for callers/references in typed code, locate the definition once (graph
get_node, LSPworkspaceSymbolor one grep), then useincomingCalls/findReferences; never grep for "X(" call sites. Untyped JavaScript (no checkJs) is the exception: userg -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.
- Graph: skip