ccsniff 1.1.9 → 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 +7 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccsniff",
3
- "version": "1.1.9",
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
@@ -263,6 +263,11 @@ if (opts['bash-discipline']) {
263
263
  // to compare watcher heartbeat against current epoch. The cat is canonical, not a deviation.
264
264
  // Same for reading .watcher.log diagnostics directly.
265
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\//;
266
271
  const violations = [];
267
272
  for (const ev of all) {
268
273
  if (!filter(ev)) continue;
@@ -275,6 +280,8 @@ if (opts['bash-discipline']) {
275
280
  if (ENDORSED_POLL.test(cmd)) continue;
276
281
  // Canonical gm-skill boot/diagnostic probes (cat .status.json; date +%s%3N etc.) are prescribed by SKILL.md.
277
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;
278
285
  const kind = SLEEP_POLL.test(cmd) ? 'sleep-poll' : (BAD_LEADING.test(cmd) ? 'bad-leading-cmd' : null);
279
286
  if (!kind) continue;
280
287
  violations.push({ ts: ev.timestamp, sid: ev.conversation.id, project: path.basename(ev.conversation.cwd || ''), kind, cmd: cmd.slice(0, 200) });