mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-09 23:12:30 +02:00
Mirror the previous commit's Windows-EPERM retry on the companion `writeWarnState` in `scripts/hooks/ecc-context-monitor.js`. Same race: two PostToolUse subprocesses writing concurrent debounce state racing on `MoveFileExW`, target-in-use throwing EPERM on Windows even though each writer's tmp path is now unique. Implementation: import `renameWithRetry` from `scripts/lib/session-bridge.js` (exported in the previous commit) instead of duplicating the helper. The retry policy, backoff schedule, and main-thread `Atomics.wait` strategy stay identical to `writeBridgeAtomic`. Three writers in the repo now share the same atomic-write contract: - `writeBridgeAtomic` (scripts/lib/session-bridge.js) — round 1 + this round's retry - `writeWarnState` (this file) — round 1 + this round's retry via shared helper - `writeCostWarningIfChanged` (scripts/hooks/ecc-metrics-bridge.js) — out of scope for this PR (already uses unique tmp suffix; a future consolidation could move it to the shared helper too). Local: `yarn test` green, `yarn lint` clean. The companion test suite for `ecc-context-monitor.js` does not currently exercise concurrent `writeWarnState` writes, but the helper it now uses is covered by the `tests/lib/session-bridge.test.js` concurrent-write regression added in round 1's last commit. |
||
|---|---|---|
| .. | ||
| auto-tmux-dev.js | ||
| bash-hook-dispatcher.js | ||
| block-no-verify.js | ||
| check-console-log.js | ||
| check-hook-enabled.js | ||
| config-protection.js | ||
| cost-tracker.js | ||
| design-quality-check.js | ||
| desktop-notify.js | ||
| doc-file-warning.js | ||
| ecc-context-monitor.js | ||
| ecc-metrics-bridge.js | ||
| ecc-statusline.js | ||
| evaluate-session.js | ||
| gateguard-fact-force.js | ||
| governance-capture.js | ||
| insaits-security-monitor.py | ||
| insaits-security-wrapper.js | ||
| mcp-health-check.js | ||
| observe-runner.js | ||
| plugin-hook-bootstrap.js | ||
| post-bash-build-complete.js | ||
| post-bash-command-log.js | ||
| post-bash-dispatcher.js | ||
| post-bash-pr-created.js | ||
| post-edit-accumulator.js | ||
| post-edit-console-warn.js | ||
| post-edit-format.js | ||
| post-edit-typecheck.js | ||
| pre-bash-commit-quality.js | ||
| pre-bash-dev-server-block.js | ||
| pre-bash-dispatcher.js | ||
| pre-bash-git-push-reminder.js | ||
| pre-bash-tmux-reminder.js | ||
| pre-compact.js | ||
| pre-write-doc-warn.js | ||
| quality-gate.js | ||
| run-with-flags-shell.sh | ||
| run-with-flags.js | ||
| session-activity-tracker.js | ||
| session-end-marker.js | ||
| session-end.js | ||
| session-start-bootstrap.js | ||
| session-start.js | ||
| stop-format-typecheck.js | ||
| suggest-compact.js | ||