/**
* Signal collector — 각 rule 에 대해 트리거들이 필요로 하는 집계 수치를 계산.
*
* 입력 소스 (on-disk):
* - ~/.forgen/state/enforcement/drift.jsonl (stuck-loop 이벤트)
* - ~/.forgen/state/enforcement/violations.jsonl (rule 위반 기록)
* - ~/.forgen/state/enforcement/bypass.jsonl (T3: 사용자 우회 기록)
*
* 모든 IO 는 이 파일에 한정. 트리거들은 pure — collectSignals() 결과를 받아 detect().
*/
import type { Rule } from '../../store/types.js';
import type { RuleSignals, ViolationEntry, BypassEntry } from './types.js';
/**
* Best-effort size-based rotation. When `p` exceeds 10MB, renames to
* `
.` so the next write starts fresh. Missing file or rename
* failures are swallowed — the caller's append will still succeed or fail
* on its own merits. Exported so enforcement-path jsonl writers outside
* this file (drift.jsonl, acknowledgments.jsonl) reuse the same policy.
*/
export declare function rotateIfBig(p: string): void;
export declare function readJsonlSafe(p: string): T[];
export declare function recordViolation(entry: Omit): void;
export declare function recordBypass(entry: Omit): void;
export interface SignalInputs {
violations?: ViolationEntry[];
bypass?: BypassEntry[];
now?: number;
}
export declare function collectSignals(rule: Rule, inputs?: SignalInputs): RuleSignals;
export declare function collectAllSignals(rules: Rule[], inputs?: SignalInputs): Map;