ccsniff 1.1.8 → 1.1.10

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 +13 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccsniff",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
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,15 @@ 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)/;
266
+ // Observability surfaces — multi-file pattern scans over JSONL logs and transcript dirs
267
+ // legitimately need grep/tail/cat because Read tool can't stream multi-file or pipe to head -c.
268
+ // gm-log/<day>/*.jsonl, .claude/projects/*/*.jsonl, and *.jsonl in general are the canonical
269
+ // observability targets per AGENTS.md "rs-learn observability" entry.
270
+ const OBSERVABILITY_TARGET = /\.(jsonl|ndjson|log)\b|gm-log\/|\.claude\/projects\//;
262
271
  const violations = [];
263
272
  for (const ev of all) {
264
273
  if (!filter(ev)) continue;
@@ -269,6 +278,10 @@ if (opts['bash-discipline']) {
269
278
  if (SPOOL_WRITE.test(cmd) && /^\s*echo\b/.test(cmd)) continue;
270
279
  // `until ...; do sleep N; done` is the harness-endorsed poll pattern.
271
280
  if (ENDORSED_POLL.test(cmd)) continue;
281
+ // Canonical gm-skill boot/diagnostic probes (cat .status.json; date +%s%3N etc.) are prescribed by SKILL.md.
282
+ if (CANONICAL_BOOT_PROBE.test(cmd)) continue;
283
+ // Observability surface reads — grep/cat/tail over JSONL logs and transcript dirs are legit (Read tool can't stream/multi-file).
284
+ if (OBSERVABILITY_TARGET.test(cmd)) continue;
272
285
  const kind = SLEEP_POLL.test(cmd) ? 'sleep-poll' : (BAD_LEADING.test(cmd) ? 'bad-leading-cmd' : null);
273
286
  if (!kind) continue;
274
287
  violations.push({ ts: ev.timestamp, sid: ev.conversation.id, project: path.basename(ev.conversation.cwd || ''), kind, cmd: cmd.slice(0, 200) });