build: unify bun quality gate

This commit is contained in:
ejclaw
2026-04-11 04:47:16 +09:00
parent f10833e818
commit 94d53e4cc3
29 changed files with 574 additions and 297 deletions

View File

@@ -11,10 +11,28 @@ const MEMORY_PATTERNS: Array<{
regex: RegExp;
keyword: string;
}> = [
{ kind: 'room_norm', regex: /(규칙|원칙|금지|반드시|하지 않|세션 시작 시에만|새 세션 시작 시에만)/i, keyword: 'rule' },
{ kind: 'preference', regex: /(선호|원함|원한다|원하는|원했다)/i, keyword: 'preference' },
{ kind: 'decision', regex: /(합의|결정|방향|기준|우선|책임지는 방향)/i, keyword: 'decision' },
{ kind: 'project_fact', regex: /(owner|reviewer|trigger|모드|메모리|기억|세션 리셋|recall|persist|compact)/i, keyword: 'memory' },
{
kind: 'room_norm',
regex:
/(규칙|원칙|금지|반드시|하지 않|세션 시작 시에만|새 세션 시작 시에만)/i,
keyword: 'rule',
},
{
kind: 'preference',
regex: /(선호|원함|원한다|원하는|원했다)/i,
keyword: 'preference',
},
{
kind: 'decision',
regex: /(합의|결정|방향|기준|우선|책임지는 방향)/i,
keyword: 'decision',
},
{
kind: 'project_fact',
regex:
/(owner|reviewer|trigger|모드|메모리|기억|세션 리셋|recall|persist|compact)/i,
keyword: 'memory',
},
];
function normalizeSentence(raw: string): string | null {
@@ -35,15 +53,15 @@ function splitSummaryIntoSentences(summary: string): string[] {
function classifyMemorySentence(content: string): SelectedCompactMemory | null {
if (!content) return null;
const matchedPatterns = MEMORY_PATTERNS.filter(({ regex }) => regex.test(content));
const matchedPatterns = MEMORY_PATTERNS.filter(({ regex }) =>
regex.test(content),
);
if (matchedPatterns.length === 0) return null;
const primary = matchedPatterns[0];
const keywords = [
...new Set(
matchedPatterns
.map((pattern) => pattern.keyword)
.filter(Boolean),
matchedPatterns.map((pattern) => pattern.keyword).filter(Boolean),
),
];