docs/ROADMAP.md asks that every skill has a test, a command, an agent, or a
README mention, or is marked for removal. Add `npm run skills:references`,
which reports that evidence per skill with file:line locations.
Tests count when a test file names the skill path (including path.join
segments), quotes the name as a whole literal, or is named after the skill;
fixtures such as the routing corpus do not. Mentions in commands, agents and
README.md count as whole tokens. Generated mirrors are not evidence, and
ambiguous text counts as a reference so a skill is never wrongly reported
as unreferenced. The report never edits anything and always exits 0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An existing 0664 log that was already at the cap was renamed to .1
before its mode was tightened, so the rotated copy stayed group/world
readable. Tighten the existing log first, and drop the post-open
fchmod that only reached the new active log.
Refs #3846
If the rename to <log>.1 fails (another session rotated first, or
Windows refuses the rename), append to the current log instead of
dropping the line.
Refs #3846
bash-commands.log and cost-tracker.log record every Bash command but
were created with the default umask (0664 in the report) and grew
without bound. appendLine now opens them with mode 0600, tightens an
existing group/world-readable log on the next write, and rotates the
log to <log>.1 once it would pass 10 MiB, keeping one rotated copy.
This mirrors the metrics.jsonl scheme in scripts/lib/gateguard-metrics.js,
inlined because hooks cannot require scripts/lib/.
Refs #3846
Filter the shipped instruction list to files selected by the install profile and make the retained paths independent of the launch directory. Record the resolved paths for repair, and anchor the bundled skill lookup to the same config root.
Refs #4029
canonicalize walked Object.keys and never called toJSON, so every Date
hashed as {}. Replay fixtures are keyed by hashValue({ tool, args }), so a
call with a different Date argument replayed the fixture recorded for
another date instead of failing with tool.fixture_missing, and the stored
response held {} where the live call returned a date.
Call toJSON with the holder key before canonicalizing, matching the JSON
coercion policy the module already follows. Plain JSON data hashes are
unchanged; the pinned byte and hash vectors still pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
digestDir hashed each file as `path \0 bytes \0` with no length, so file
contents holding NUL could absorb the following files: a one-file tree and
a two-file tree produced the same digest. Frame each file as
`path \0 byteLength \0 bytes`.
Entries were also sorted with localeCompare, which follows the host locale
(sv_SE sorts `ä` after `z`), so the same tree got different digests on
different machines. Sort by code point.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>