feat(retry): telemetry ai_retry_manual + stats AI 수동 재시도 (#2 v0.2.3)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -250,3 +250,31 @@ describe('ollama_unreachable / ollama_recovered / ollama_recheck_manual events',
|
||||
})).toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('ai_retry_manual event', () => {
|
||||
it('parses valid ai_retry_manual', () => {
|
||||
const ev = validateEvent({
|
||||
ts: '2026-05-01T00:00:00.000Z',
|
||||
kind: 'ai_retry_manual',
|
||||
payload: { failedCount: 5 }
|
||||
});
|
||||
if (ev.kind !== 'ai_retry_manual') throw new Error('discriminant');
|
||||
expect(ev.payload.failedCount).toBe(5);
|
||||
});
|
||||
|
||||
it('rejects ai_retry_manual with failedCount=0 (≥1 invariant)', () => {
|
||||
expect(() => validateEvent({
|
||||
ts: '2026-05-01T00:00:00.000Z',
|
||||
kind: 'ai_retry_manual',
|
||||
payload: { failedCount: 0 }
|
||||
})).toThrow();
|
||||
});
|
||||
|
||||
it('rejects ai_retry_manual with extra payload field (privacy invariant)', () => {
|
||||
expect(() => validateEvent({
|
||||
ts: '2026-05-01T00:00:00.000Z',
|
||||
kind: 'ai_retry_manual',
|
||||
payload: { failedCount: 5, rawText: 'leak' }
|
||||
})).toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user