Commit Graph
1670 Commits
Author SHA1 Message Date
Gaurav Dubey 9e6272d5df fix(hooks): keep recording the command when log rotation fails
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
2026-11-19 03:57:06 +00:00
Gaurav Dubey c940659dab fix(hooks): create command logs owner-only and rotate them
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
2026-11-19 03:35:48 +00:00
wellkilo 87ad04ff0c refactor(opencode): build projected config without mutation 2026-11-18 19:24:55 -08:00
wellkilo 48b63aa711 fix(opencode): resolve home instructions from the install plan
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
2026-11-18 19:19:39 -08:00
Afloat ec6237570b refactor: collect Python dependencies without mutation
Signed-off-by: Afloat <ShuffleMonkey@163.com>
2026-11-19 10:43:56 +08:00
Afloat 11d5bc0a8a refactor: keep recent summary turns immutable
Signed-off-by: Afloat <ShuffleMonkey@163.com>
2026-11-19 10:43:54 +08:00
NeoandClaude Opus 5.5 18f1db503a docs(eval-harness): describe digest sort as UTF-16 code-unit order
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 20:33:37 -05:00
NeoandClaude Opus 5.5 06aeab9aa1 fix(eval-harness): canonicalize toJSON values as JSON.stringify does
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>
2026-11-18 20:32:52 -05:00
NeoandClaude Opus 5.5 0bc6d1d052 fix(eval-harness): make variant directory digests unique and locale-independent
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>
2026-11-18 20:27:38 -05:00
Labish Bardiya 0f5f6873ee fix(opencode): ship missing command subagents 2026-11-19 01:45:32 +05:30
vnegriyandClaude Opus 5.5 8b4723a613 fix(atomic-write): size the rename attempt cap for the shortest wait
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>
2026-11-18 21:28:58 +03:00
vnegriyandClaude Opus 5.5 aa92c3ec1e fix(install-state): stop concurrent Windows writers from starving on rename
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>
2026-11-18 20:47:15 +03:00
Rudy Celekli f32b2f1ee1 fix(eval-harness): retry transient Windows fixture reads 2026-11-18 01:08:33 -05:00
Rudy Celekli 02855f45d0 fix(openspec): normalize inherited Git pathspec options 2026-11-18 01:08:33 -05:00
Rudy Celekli b64e30be6c fix(mcp): use the dispatched tool namespace for health checks 2026-11-18 01:06:49 -05:00
Rudy Celekli 0a143b8b68 fix(statusline): preserve newer tool metrics during context updates 2026-11-18 01:04:50 -05:00
Rudy Celekli db1cbd0617 fix(nasiko): identify missing qualified registry manifests 2026-11-18 01:01:16 -05:00
Rudy Celekli f4261bd83c fix(eval-harness): preserve fixtures when recording fails 2026-11-18 00:55:35 -05:00
Rudy Celekli 59bf23876f fix(openspec): query history for literal anchor paths 2026-11-18 00:55:05 -05:00
Divya Chukkapalli a36d68cb7d fix(ci): scan pnpm and nested node_modules in the IOC scanner
walkNodeModules skipped every dotted entry and only looked at
node_modules/<name> and node_modules/@scope/<name>. pnpm keeps real
package directories under node_modules/.pnpm and links the top-level
entries, which Dirent.isDirectory() reports as non-directories, so a pnpm
project had zero installed packages inspected. npm's nested
node_modules were never reached either.

Walk the .pnpm virtual store and nested node_modules directories. Links
are still not followed.
2026-11-17 04:20:14 -08:00
Divya Chukkapalli ad90aa6701 fix(hooks): keep a GateGuard deny when another Bash hook adds context
GateGuard denies by printing a PreToolUse permissionDecision on stdout at
exit 0. runHooks only stopped early on a non-zero exit, and its final
return preferred any advisory additionalContext over the hook stdout, so
in the strict profile the git-push reminder replaced GateGuard's deny and
the command ran. Stop at the first deny and return it unchanged.
2026-11-17 04:17:35 -08:00
adityajai119 6c78d56d91 fix(cli): honor global --dry-run in auto-update, setup, and nasiko
ecc.js strips a leading --dry-run flag and sets ECC_DRY_RUN=1 before
spawning subcommands. auto-update.js, setup.js, and nasiko.js did not
read ECC_DRY_RUN, so running ecc --dry-run before those subcommands
still ran git fetch/pull, mutated Claude plugins and settings, or
installed/removed Nasiko binaries.

Read and validate ECC_DRY_RUN ("0" or "1") in parseArgs() for
auto-update.js and setup.js and in parseMutationArguments() for
nasiko.js, matching uninstall.js, repair.js, install-apply.js, and
install-guided.js.

Fixes #3981
2026-11-17 14:23:47 +05:30
Afloat e5d055f2a7 chore: merge main and refresh context registry
Signed-off-by: Afloat <ShuffleMonkey@163.com>
2026-11-17 16:22:48 +08:00
Yann Roberto 2b559c058f fix(ci): validate OpenSpec baseline headings in CRLF files 2026-11-17 16:03:16 +08:00
haelyra 3f14a103a8 Merge pull request #3969 from shoyann/fix/validate-duplicate-hook-events
fix(ci): catch duplicate hook events before JSON parsing
2026-11-17 01:41:46 -05:00
Afloat 4ffff8d4c7 fix(instincts): align alias boundaries and disambiguate Go prose 2026-11-17 14:04:52 +08:00
Afloat e9300358da fix(formatter): honor equivalent Windows home paths 2026-11-17 14:04:49 +08:00
Afloat 89a8bbc205 fix(instincts): recognize canonical framework and language aliases 2026-11-17 13:55:18 +08:00
Afloat 69bbf04bc7 fix(formatter): find shared workspace config above package manifests 2026-11-17 13:54:47 +08:00
Afloat a55b14fe36 fix(proximity): resolve emitted module paths to TypeScript sources 2026-11-17 13:49:39 +08:00
Yann Roberto 8fba4889ae Merge main and sync hook validator dependency locks 2026-11-17 13:47:44 +08:00
Yann Roberto aa4b0c1700 fix(ci): check matcher IDs in unwrapped hook maps 2026-11-17 13:45:52 +08:00
haelyra 562b541581 Merge reviewed PR #3106: opt-in context-gate hook 2026-11-17 00:45:08 -05:00
Yann Roberto 0268e2ef40 fix(ci): reject duplicate root keys in hook documents 2026-11-17 13:29:40 +08:00
Yann Roberto 244210bbd1 fix(ci): detect duplicate events in unwrapped hook maps 2026-11-17 11:53:01 +08:00
Yann Roberto 9de259d581 fix(ci): reject duplicate hook events and report duplicate ID lines 2026-11-17 11:26:43 +08:00
Afloat a796cab879 fix(project-detect): retain multiline continuations and array boundaries 2026-11-17 11:23:16 +08:00
haelyra 4b28aa9fe4 test: keep integrated fixtures out of the shared temp directory
Repair the CodeQL findings introduced by this integration without
dismissing any alert:

- OpenSpec validators: express the empty-symbol check as an explicit
  slice instead of an index-versus-length comparison (#2679).
- OpenSpec tests: create file and outside-target fixtures inside private
  mkdtemp directories (#2679).
- Antigravity policy test: give the bridge a private TMPDIR/TEMP/TMP so
  its edit accumulator never lands in the shared temp directory (#3221).
- Session recording test: write partial bytes through the staging
  descriptor and read the saved file through one opened handle (#3952).

Behavior and assertions are unchanged; each focused suite passes.
2026-11-16 22:03:55 -05:00
Afloat d96596b4e0 fix(hooks): include module extensions in edit and Stop checks 2026-11-17 11:02:44 +08:00
haelyra c64b9ad6e0 Merge reviewed PR #2679: standalone OpenSpec validators 2026-11-16 22:01:04 -05:00
haelyra d64bf7d2b6 Merge reviewed PR #3584: preserve exact lifecycle worktree paths 2026-11-16 22:01:04 -05:00
haelyra e7b578939e Merge reviewed PR #3100: Mistral Vibe native skill target
# Conflicts:
#	README.md
#	manifests/context-packs/skill-triggers@1.json
#	schemas/context-carrier.schema.json
#	scripts/lib/install-manifests.js
#	tests/lib/harness-capabilities.test.js
2026-11-16 22:01:03 -05:00
haelyra 7bb8c65afc Merge reviewed PR #3221: experimental native Antigravity plugin and hooks 2026-11-16 22:00:42 -05:00
Afloat f9f3ed5ccf fix(project-detect): preserve TOML key and multiline string boundaries 2026-11-17 11:00:19 +08:00
Afloat f2d23ded28 fix(skill-tracker): serialize append and retention across processes 2026-11-17 10:53:25 +08:00
Afloat 87323fb125 fix(project-detect): scan unfinished and inline dependency arrays safely 2026-11-17 10:49:07 +08:00
Afloat 887eccc271 perf(sessions): stop parsing after the most recent summary turns 2026-11-17 10:34:46 +08:00
Afloat 5c7eeba436 fix(transcripts): complete short reads within the requested tail 2026-11-17 10:34:44 +08:00
Afloat 0a7340cbc5 fix(project-detect): preserve extras in Python dependency arrays 2026-11-17 10:34:42 +08:00
Afloat 0b342071a0 perf(project-detect): scan root extensions once per detection 2026-11-17 10:34:29 +08:00