ccsniff 1.1.8 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli.js +6 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccsniff",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "description": "Watch Claude Code JSONL output files and emit structured events as a Node.js EventEmitter",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
package/src/cli.js CHANGED
@@ -259,6 +259,10 @@ if (opts['bash-discipline']) {
259
259
  // and Monitor docs). Same for `while !curl ...; do sleep N; done`. These are
260
260
  // NOT sleep-poll violations even though they contain `sleep N`.
261
261
  const ENDORSED_POLL = /^\s*(until|while)\s+/;
262
+ // gm-skill SKILL.md prescribes the boot probe `cat .gm/exec-spool/.status.json; date +%s%3N`
263
+ // to compare watcher heartbeat against current epoch. The cat is canonical, not a deviation.
264
+ // Same for reading .watcher.log diagnostics directly.
265
+ const CANONICAL_BOOT_PROBE = /\.gm\/exec-spool\/\.(status\.json|watcher\.log|bootstrap-(status|error)\.json|last-session-start\.json)/;
262
266
  const violations = [];
263
267
  for (const ev of all) {
264
268
  if (!filter(ev)) continue;
@@ -269,6 +273,8 @@ if (opts['bash-discipline']) {
269
273
  if (SPOOL_WRITE.test(cmd) && /^\s*echo\b/.test(cmd)) continue;
270
274
  // `until ...; do sleep N; done` is the harness-endorsed poll pattern.
271
275
  if (ENDORSED_POLL.test(cmd)) continue;
276
+ // Canonical gm-skill boot/diagnostic probes (cat .status.json; date +%s%3N etc.) are prescribed by SKILL.md.
277
+ if (CANONICAL_BOOT_PROBE.test(cmd)) continue;
272
278
  const kind = SLEEP_POLL.test(cmd) ? 'sleep-poll' : (BAD_LEADING.test(cmd) ? 'bad-leading-cmd' : null);
273
279
  if (!kind) continue;
274
280
  violations.push({ ts: ev.timestamp, sid: ev.conversation.id, project: path.basename(ev.conversation.cwd || ''), kind, cmd: cmd.slice(0, 200) });