MCPcopy Create free account
hub / github.com/SethGammon/Citadel / assertHooksFired

Function assertHooksFired

scripts/skill-bench.js:597–603  ·  view source on GitHub ↗

* Assert hooks fired by comparing telemetry before/after. * Returns array of hook assertion strings that failed, or empty if all pass.

(tmpDir, before)

Source from the content-addressed store, hash-verified

595 * Returns array of hook assertion strings that failed, or empty if all pass.
596 */
597function assertHooksFired(tmpDir, before) {
598 const after = snapshotTelemetry(tmpDir);
599 const failures = [];
600 if (after.timing <= before.timing) failures.push('hook-timing.jsonl did not grow (hooks may not have fired)');
601 if (after.errors > before.errors) failures.push(`${after.errors - before.errors} new hook error(s) — check hook-errors.log`);
602 return failures;
603}
604
605// ── Claude CLI detection ──────────────────────────────────────────────────────
606

Callers 1

mainFunction · 0.85

Calls 1

snapshotTelemetryFunction · 0.85

Tested by

no test coverage detected