ECC/tests/lib
djpjronline-netizen 837acaf20b
fix(hooks,lib): fix hook detection and parsing edge cases (#2405)
* fix(hooks,lib): fix hook detection and parsing edge cases

- auto-tmux-dev: dev\b -> dev(?![\w-]) so one-shot dev-build/dev-docs scripts
  are not detached into tmux; align command shapes (yarn run dev, bun dev) with
  pre-bash-dev-server-block.js DEV_PATTERN.
- pre-bash-commit-quality: skip obvious non-secret placeholders (env refs,
  ${...}, <...>, whitelisted tokens) in the api-key rule without suppressing
  real high-entropy secrets; make -m message extraction quote- and
  escaped-quote-aware so `-m "fix: \"x\""` / apostrophes are not truncated.
- pre-compact: annotate the CURRENT worktree's session (match **Worktree:** /
  legacy **Project:**) instead of the newest *-session.tmp across all projects,
  layered onto the LLM-summary flow from #2388; a present-but-blank Worktree
  header is treated as non-legacy (no foreign project fallback).
- shell-substitution: stop double-appending a trailing backslash in an
  unterminated backtick span.
- utils readStdinJson: on overflow, settle and resolve {} immediately (clear
  timer + listeners) instead of waiting for end/timeout and parsing a partial
  prefix; surface the overflow on stderr.

Regression tests added/extended (new tests/hooks/pre-compact.test.js).

Addresses review feedback on #2405. The earlier block-no-verify change was
dropped: its message-value skip on merge/cherry-pick/am/rebase would let
`git rebase -m --no-verify` bypass the hook (rebase's -m is the boolean
--merge), a false-negative worse than the contrived false-positive it fixed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(ci): align hook fixtures and drain oversized stdin

---------

Co-authored-by: djpjronline-netizen <276112803+djpjronline-netizen@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: haelyra <49814733+haelyra@users.noreply.github.com>
2026-07-28 21:32:42 -04:00
..
agent-compress.test.js fix: use scalar Claude agent tools (#2583) 2026-07-26 03:20:15 -07:00
agent-data-home.test.js fix: harden local dashboard and data boundaries (#2585) 2026-07-27 11:11:29 -07:00
agent-proximity.test.js feat(layer4): line-range channel + trigger firing 2026-06-20 17:30:52 -04:00
changed-files-store.test.js fix: port safe ci cleanup from backlog 2026-04-01 16:09:54 -07:00
command-plugin-root.test.js fix(resolve-ecc-root): require ECC skills, not just scripts, before accepting a root (#2544) (#2577) 2026-07-25 22:21:27 -07:00
control-pane-actions.test.js feat: add ECC2 local control pane (#2131) 2026-06-03 21:54:30 +08:00
control-pane-message-sink.test.js feat(layer4): live messages-table wiring for proximity triggers 2026-06-20 20:49:17 -04:00
control-pane-proximity.test.js feat(layer4): live messages-table wiring for proximity triggers 2026-06-20 20:49:17 -04:00
control-pane-state.test.js feat(control-pane): add agent+human JIT assignment view to the work-items board 2026-06-18 16:59:30 -04:00
cost-estimate.test.js feat: add ECC statusline observability hooks 2026-05-11 23:44:06 -04:00
dry-run.test.js fix(hooks): preserve Stop output through lifecycle wrappers (#2493) 2026-07-26 00:01:57 -07:00
github-coordination-branches.test.js fix(opencode): normalize tool paths across platforms (#2459) 2026-07-26 03:13:49 -07:00
github-coordination-policy.test.js fix(opencode): normalize tool paths across platforms (#2459) 2026-07-26 03:13:49 -07:00
github-coordination-store.test.js fix(opencode): normalize tool paths across platforms (#2459) 2026-07-26 03:13:49 -07:00
github-coordination.test.js fix: address second round of code-review findings 2026-06-11 14:25:58 -04:00
inspection.test.js feat: agent compression, inspection logic, governance hooks (#491, #485, #482) (#688) 2026-03-20 01:38:13 -07:00
install-claude-skill-migration.test.js fix: flatten Claude skill installs (#2582) 2026-07-26 03:20:06 -07:00
install-config.test.js feat: add install catalog and project config autodetection 2026-03-27 05:56:39 -04:00
install-executor.test.js fix: flatten Claude skill installs (#2582) 2026-07-26 03:20:06 -07:00
install-lifecycle.test.js fix: harden local dashboard and data boundaries (#2585) 2026-07-27 11:11:29 -07:00
install-link-rewrite.test.js fix: flatten Claude skill installs (#2582) 2026-07-26 03:20:06 -07:00
install-manifests.test.js feat: add cross-harness memory vault (#2581) 2026-07-26 02:46:59 -07:00
install-request.test.js fix(installer): harden locale docs install 2026-05-17 20:46:04 -04:00
install-state.test.js fix: harden release surface version and packaging sync (#1388) 2026-04-12 22:33:32 -07:00
install-targets.test.js fix: flatten Claude skill installs (#2582) 2026-07-26 03:20:06 -07:00
llm-summary.test.js fix(tests): use mkdtempSync for test scratch dirs (CodeQL js/insecure-temporary-file) (#2443) 2026-07-04 13:44:27 -07:00
locale-install.test.js fix: flatten Claude skill installs (#2582) 2026-07-26 03:20:06 -07:00
loopback-guard.test.js fix: harden local dashboard and data boundaries (#2585) 2026-07-27 11:11:29 -07:00
mcp-config.test.js feat: support disabling bundled mcp servers 2026-04-05 14:37:28 -07:00
mcp-inventory.test.js feat: MCP inventory (ecc.mcp.v1) — unified cross-harness MCP config view (#2146) 2026-06-06 03:55:17 +08:00
memory-schema.test.js feat: add cross-harness memory vault (#2581) 2026-07-26 02:46:59 -07:00
memory-vault.test.js feat: add cross-harness memory vault (#2581) 2026-07-26 02:46:59 -07:00
observer-sessions.test.js fix: port continuous-learning observer fixes 2026-05-11 03:35:42 -04:00
orchestration-session.test.js fix: retire legacy command shims from default surface 2026-04-29 23:56:40 -04:00
package-manager.test.js fix(scripts): detect modern bun.lock, ignore stray root lockfiles 2026-07-19 19:39:23 +02:00
path-safety.test.js fix: harden local dashboard and data boundaries (#2585) 2026-07-27 11:11:29 -07:00
plan-canvas-markdown.test.js fix(plan-canvas): stop dropping list items when a block's first item is over-indented (#2501) 2026-07-17 17:10:58 -04:00
plan-canvas-sessions.test.js feat: Plan Canvas, a browser review canvas for plans (#2467) 2026-07-08 17:12:48 -04:00
project-detect.test.js fix(project-detect): parse Python deps pinned with ~ and @ (was losing framework detection on compatible-release pins) (#2498) 2026-07-17 17:11:09 -04:00
resolve-ecc-root.test.js fix(resolve-ecc-root): require ECC skills, not just scripts, before accepting a root (#2544) (#2577) 2026-07-25 22:21:27 -07:00
resolve-formatter.test.js fix: harden Trae install ownership (#1013) 2026-03-30 02:01:54 -04:00
selective-install.test.js fix: flatten Claude skill installs (#2582) 2026-07-26 03:20:06 -07:00
session-adapters-codex.test.js feat: extend session-adapter layer with codex-worktree + opencode adapters (#2145) 2026-06-06 03:55:00 +08:00
session-adapters-opencode.test.js feat: extend session-adapter layer with codex-worktree + opencode adapters (#2145) 2026-06-06 03:55:00 +08:00
session-adapters.test.js test: cover session adapter edge cases 2026-04-29 18:21:31 -04:00
session-aliases.test.js test: skip chmod-based permission tests when running as root (#2171) 2026-06-07 13:25:53 +08:00
session-bridge.test.js test(lib): make concurrent-write test actually concurrent + use regex matcher for assert.throws 2026-05-19 04:57:10 -04:00
session-manager.test.js refactor: consolidate duplicated hook-root resolver into shared resolveEccRoot() (#2368) (#2410) 2026-07-03 20:01:17 -07:00
shell-split.test.js fix(hooks): allow tmux-wrapped dev server commands (#321) 2026-03-07 14:47:49 -08:00
shell-substitution.test.js fix(hooks,lib): fix hook detection and parsing edge cases (#2405) 2026-07-28 21:32:42 -04:00
skill-dashboard.test.js test: cover skill dashboard edge paths 2026-04-29 19:15:47 -04:00
skill-evolution.test.js test: cover skill tracker edge paths 2026-04-29 19:21:03 -04:00
skill-improvement.test.js feat: self-improving skills loop — observe, inspect, amend, evaluate 2026-03-14 23:21:18 -07:00
state-store.test.js feat: sync GitHub queue into work items 2026-05-11 13:07:29 -04:00
tmux-worktree-orchestrator.test.js fix: retire legacy command shims from default surface 2026-04-29 23:56:40 -04:00
transcript-context.test.js fix(suggest-compact): recognize large-window model families without a [1m] marker (#2468) 2026-07-22 12:17:11 -04:00
utils.test.js fix(hooks,lib): fix hook detection and parsing edge cases (#2405) 2026-07-28 21:32:42 -04:00
worktree-lifecycle.test.js feat: worktree-lifecycle service (deterministic conflict prediction + safe GC) (#2164) 2026-06-07 13:00:08 +08:00