690519:1719 224 to 226 AI #02
CI / CD Pipeline / build (push) Successful in 4m47s
CI / CD Pipeline / deploy (push) Failing after 7m3s

This commit is contained in:
2026-05-19 17:19:24 +07:00
parent ea5499123e
commit 7259cbf67a
30 changed files with 783 additions and 878 deletions
@@ -58,14 +58,9 @@ describe('PatternMatcherService — Performance', () => {
expect(result?.intentCode).toBe('SUMMARIZE_DOCUMENT');
const avg = times.reduce((a, b) => a + b, 0) / times.length;
const max = Math.max(...times);
const _max = Math.max(...times); // Kept for potential future debugging
const p95 = times.sort((a, b) => a - b)[Math.floor(times.length * 0.95)];
// eslint-disable-next-line no-console -- performance logging allowed in test
console.log(
`Pattern Match Perf: avg=${avg.toFixed(3)}ms, p95=${p95.toFixed(3)}ms, max=${max.toFixed(3)}ms`
);
// SC-001: synthetic worst-case (100+ patterns รวม 50 invalid regex try-catch)
// ค่า threshold สูงเพื่อรองรับ CI/IDE background load — regression detection only
// Production (keyword-only, 10-20 patterns): < 1ms
@@ -100,11 +95,6 @@ describe('PatternMatcherService — Performance', () => {
const avg = times.reduce((a, b) => a + b, 0) / times.length;
const p95 = times.sort((a, b) => a - b)[Math.floor(times.length * 0.95)];
// eslint-disable-next-line no-console -- performance logging allowed in test
console.log(
`Pattern Miss Perf: avg=${avg.toFixed(3)}ms, p95=${p95.toFixed(3)}ms`
);
// SC-001: worst-case full scan (100+ patterns รวม 50 invalid regex try-catch)
// Production keyword-only จะ < 1ms — ค่านี้เพื่อ regression detection
expect(avg).toBeLessThan(200);