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>
Review feedback (CodeRabbit, Greptile): the attempt cap still assumed
25 ms per wait, but the jittered waits average about 15 ms, so writers
ran out of attempts at roughly 1 s on the default budget and about 5 s
on the 10 s install-state budget.
- Derive the safety cap from the minimum wait, so the elapsed budget is
what actually stops retries.
- Raise the minimum jittered wait from 1 ms to 5 ms. That keeps the
safety cap meaningful (401 attempts per default write) while the
5-25 ms spread still breaks contender lockstep.
- Add tests whose fake clock advances by the requested wait. They fail
on the previous commit (retries stopped at 1073 ms and 5127 ms) and
pass now.
- Update the session-aliases bound that encoded the old cap.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Windows, concurrent writeInstallState calls (and real-time antivirus
scans of each freshly published file) can hold replacement sharing locks
for over a second. renameAtomic retried at a fixed 25 ms interval, which
kept contenders in lockstep, so one writer could lose every round and
give up with EPERM at the 2 s deadline. This made
tests/lib/install-state.test.js fail in about half of isolated runs.
- Retry with a uniform random wait of 1-25 ms instead of a fixed 25 ms.
Exponential backoff was measured and made starvation worse.
- Add a renameRetryBudgetMs option to writeFileAtomic. The default stays
2 s, so hook callers keep their latency bound, and the attempt cap is
derived from the budget (81 for the default).
- writeInstallState uses a 10 s budget, since it runs only during installs.
Measured on Windows 11 with Defender on: install-state test 0/12
failures (previously 4/8).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main kept evolving pre-bash-dev-server-block.js while this branch waited:
tmux pane-launch detection past tmux options and command sequences, bash
double-quote backslash rules, here-document segment scanning and an indexed
segment queue. Resolve by keeping this branch's thin hook and moving main's
current helpers into scripts/lib/dev-command.js, so both dev hooks still
share one classifier without losing main's tmux behavior.
The same resolution makes package-manager option arity manager-specific,
as requested in review: npm -d / pnpm -d are loglevel flags, pnpm -w is
--workspace-root, bun -d is --define <K:V>. A shared value table swallowed
the script after the boolean spellings, so `npm -d run dev` escaped tmux.
Refresh the Mistral Vibe skill target on current main. Keep main's
Copilot and Grok targets, agent/skill/locale selectors and install-config
cases alongside the mistral-vibe target, and take main's skill-triggers
manifest so the digest matches the current catalog.
An Antigravity home whose workflows directory resolves outside the
trusted config root made resolveTrustedRoots throw out of the doctor
loop, hiding results for every other installed target. Report it as an
unsafe-trusted-root error for that target instead, with a regression.
Also align the README support row with the pinned CLI 1.3.5 validation
and leave the shipped 2.2.0 release notes unchanged.
Resolve conflicts with grok target and repair source-root changes:
keep both antigravity-home and grok targets, combine main's repair
source root with the PR's trusted-root selection, and rebind the
skill-trigger registry digest to the merged install registry.
A first-touch denial marks its file checked so the retry passes, which
also let the other edits to that file in the same parallel batch apply
and left the file half-edited (#3136 only warned about this).
When the denied call's own tool_use_id is found in the transcript, the
denial now records the batch (assistant message id) for that file in
the same state write. A later Edit/Write/MultiEdit/NotebookEdit of the
file from that batch is denied with a message that says to resend every
edit with the retry. Calls from any other message pass, including the
retry. There is no newest-message fallback, so a guessed batch can never
deny the retry; without a located batch the #3136 warning still applies.
Same-batch denials are recorded as the new `batch-deny` metrics
decision and do not count toward fact_force_denials. batch_locks is
validated on read, merged by newest `at` and capped at 50 entries.
Fixes#3936
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ECC's selection, candidates, fallback and receipt stay unchanged. Installed non-ECC skills that also match the task are listed as companions in the resolver result, the ecc profile run launch input and the opt-in suggestion hook, so the host can use ECC's skill and the user's own together. A companion clears the automatic-load score bar and either has a matched word in its name or leads every other neighbor by the existing auto-admission margin. No constant changes.
ecc profile neighbors snapshots the provider home's other skills, including the project's own .claude/skills for Claude, and --neighbors or ECC_CONTEXT_NEIGHBORS passes the snapshot in.
Resolve both sides of the source_doc containment check with
fs.realpathSync.native (falling back to fs.realpathSync). With the JS
realpath, a repo root reached through a Windows 8.3 short name stays in
short form while an in-repo symlink whose target uses the long-path form
resolves to the long form, so a legitimate in-repo doc was reported as
"resolves outside repository root". Escapes outside the repo are still
rejected.
Adds a cross-platform regression test that models differing JS and
native realpath results: in-repo docs are accepted through a short-form
root and an outside target is still rejected. It fails on the previous
implementation.
Not required for the #3882 Windows CI fix; kept as a separate commit so
it can be taken or dropped on its own.