정확성 규칙 다이어트: VERIFY CONCRETE FACTS를 숫자 사실(스펙·가격·버전·출시일·통계)로 좁히고 일반 지식·추천·설명·대화 속 숫자 계산은 "기억에 기대어" 단서 없이 바로 답하라고 명시, 증시 개장일 문장은 장/증시/영업 질문에만 — "몬태나 살기 좋은 곳"에 "제 기억에 기대어 쓰는 것이라…" 단서가 붙던 것(comparisons·options·"확신해도"가 추천 질문까지 덮음). 제품 스펙·세대는 isFactualInfoRequest 리마인더와 STALE-VERSION 가드가 따로 잡음. 재현: 단서 사라짐 2/2, 확인질문 "네" 2/2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
kimandClaude Opus 5.5 committed 2026-10-25 10:31:38 +09:00
1 parent 0f561a456a
commit a9827f4392
1 file changed
+10 -2
+10 -2
View File
@@ -248,8 +248,16 @@ export function buildChatSystemPrompt(input: SystemPromptInput): string {
// isFactualInfoRequest가 주입하는 리마인더와 사실상 동일하다(개인 인프라 예외까지 양쪽에 중복).
// 즉 정작 필요한 턴에는 같은 지시를 두 번 내고, 나머지 턴에는 못 쓸 지시에 245토큰을 냈다.
// 도구 게이팅이므로 이 파일 규칙 1을 어기지 않는다 — 조건이 규칙의 실행 가능성과 정확히 같다.
// 2026-10-25 정확성 규칙 다이어트: 위 VERIFY에서 "comparisons / what models/options exist"와 "확신해도"를
// 일반 질문까지 넓게 읽어 "살기 좋은 곳" 같은 추천에도 "제 기억에 기대어…" 단서를 달았다. 제품 스펙·가격·세대는
// isFactualInfoRequest 리마인더와 STALE-VERSION 가드가 따로 잡으므로 여기선 숫자 사실로 좁히고, 그 밖은 바로
// 답하라고 명시한다. 증시 개장일 문장은 그런 질문에만 필요해 메시지로 게이팅(빠져도 비용은 한 번의 틀린 '장 열림').
const marketDayRule = /장\s*(열|마감|시작|중)|증시|주식|코스피|코스닥|나스닥|다우|s&p|거래\s*(시간|일)|개장|휴장|영업\s*(시간|중|해|하)|문\s*(열|닫)|열었|열려|market|trading|nyse|nasdaq|open\s+(now|today)/i
.test(`${input.prevUserMessage || ''}\n${input.message || ''}`)
? " Before answering whether something is open/trading/in-session RIGHT NOW (stock markets, exchanges, offices, stores), first check today's day-of-week against real-world facts (e.g. NYSE and KOSPI do not trade on Saturdays, Sundays, or market holidays, regardless of what time it is) — a market-hours formula alone is not enough if today isn't even a trading day."
: '';
const verifyFactsRule = toolNames.has('web_search')
? ' VERIFY CONCRETE FACTS: for questions with a checkable real-world answer — specs, prices, versions, release dates, comparisons, "what models/options exist" — call web_search first and base the answer on what it returns, even if you\'re confident you already know it. Specific-sounding numbers you produce from memory (TFLOPS, VRAM, prices, dates) are exactly the kind of detail that goes stale or was never right — don\'t present them as fact unless a tool actually returned them. This does NOT apply to coding help, creative writing, opinions, or general reasoning — only to claims a search could confirm or refute. This also does NOT apply to the user\'s own private infra nicknames (지서버, 클로서버, and similar) — those are personal hardware, not public products, so web_search cannot verify them; answer those from USER.md/SOUL.md/[RECALLED_FACTS] context instead.'
? ' VERIFY CONCRETE FACTS: specs, prices, versions, release dates and statistics (population, rates, rents) — call web_search first and answer from what it returns, even if you feel sure; never present such a number from memory as fact. Everything else — general knowledge, explanations, recommendations, opinions, reasoning, arithmetic on numbers already in the conversation — answer directly and plainly, without disclaimers like "제 기억에 기대어 쓰는 것이라". The user\'s private infra nicknames (지서버, 클로서버, …) are not web-searchable: answer those from USER.md/[RECALLED_FACTS].'
: '';
// FILE/MODEL SEARCH (2026-09-21). Logged failure: user asked the 작업실(workshop) chat to find
// an STL for a K2 Combo exhaust duct adapter. The model fired ONE web_search and gave up on the
@@ -282,6 +290,6 @@ export function buildChatSystemPrompt(input: SystemPromptInput): string {
return isTranslateSession ? `You are a medical translator. Translate the given text into natural Korean, preserving paragraph structure and markdown formatting (##, ###, **bold**, bullet lists). Output ONLY the translation — no commentary, no tool calls, no explanations.` : isProjSession ? `You are a project file designer. Output ONLY the project-files JSON block as instructed. No tool calls. No extra text.` : `${executionModeSystemBlock ? `${executionModeSystemBlock}\n\n` : ''}You are SmallClaw, a local AI assistant. The language model behind you right now is ${backendLabel} — if the user asks which model/AI you are, say exactly that (a stronger model may take over hard questions when routing is on) and never guess other names. Always answer in the language of the user's latest message (Korean question → Korean answer), even when search results or tool output are in English; never open with an English sentence for a Korean question.\nCurrent date: ${dateStr}, ${timeStr}.\nNever search for or link SmallClaw repos unless the user is asking about SmallClaw itself.\nThis app runs on the user's own machine — browser/desktop automation requests are pre-authorized.\nKeep CONVERSATIONAL and TASK-EXECUTION replies SHORT (2-4 sentences). Don't think out loud. Act and report. Greet naturally without tools. Two carve-outs to that brevity rule: (1) informational answers you researched with a tool (news, weather, factual explanations, comparisons) are not held to 2-4 sentences, but size them to the question: lead with the answer, and leave out background, caveats and closing offers ("더 필요하시면…") the user did not ask for. (2) Stating uncertainty never counts against the length — but only when it is about what was asked: if a search came back empty, or the specific figure or fact you were asked for simply isn't in the results, spend the extra sentence to say so plainly ("검색 결과에는 이 조합의 실측치가 없어서 단정하기 어렵습니다") instead of compressing it into a confident-sounding one-liner. Brevity pressure must never be the reason you state something as fact — a slightly longer honest answer beats a short wrong one every time. That carve-out does not cover general caveats about how you searched or what the search might have missed, and do not close with an offer to search again in other ways.
${continuityRule}
ANTI-HALLUCINATION: When a tool returns a result, report EXACTLY what the tool returned — never contradict or ignore tool output. If a tool says "(no rows)", say so. Never invent data, file contents, table names, or command output. If you don't know something, call a tool to find out or say you don't know.${verifyFactsRule}
TEMPORAL CONSISTENCY: The current date and day-of-week is given above ("Current date: ${dateStr}") — this is ground truth, more reliable than any search snippet's phrasing. Before answering whether something is open/trading/in-session RIGHT NOW (stock markets, exchanges, offices, stores), first check today's day-of-week against real-world facts (e.g. NYSE and KOSPI do not trade on Saturdays, Sundays, or market holidays, regardless of what time it is) — a market-hours formula alone is not enough if today isn't even a trading day.${searchReadingRule}${searchPersistenceRule}${fileSearchRule}${imageEditRuleBlock}${mediaGenRuleBlock}${browserRuleBlock}${chemistryRuleBlock}${mapsRuleBlock}${placeSearchRuleBlock}${routeSearchRuleBlock}${codeOutputRuleBlock}${packageInstallRuleBlock}
TEMPORAL CONSISTENCY: The current date and day-of-week is given above ("Current date: ${dateStr}") — this is ground truth, more reliable than any search snippet's phrasing.${marketDayRule}${searchReadingRule}${searchPersistenceRule}${fileSearchRule}${imageEditRuleBlock}${mediaGenRuleBlock}${browserRuleBlock}${chemistryRuleBlock}${mapsRuleBlock}${placeSearchRuleBlock}${routeSearchRuleBlock}${codeOutputRuleBlock}${packageInstallRuleBlock}
OUTPUT FORMAT: When presenting 3+ items (emails, search results, lists), always use a markdown table or structured bullet list with clear headers. Never dump them as a long paragraph.${newsFormatRule}${weatherFormatRule}${modelProfileBlock}${callerContext ? '\n\n' + callerContext : ''}${browserStateCtx}${personalityCtx}${skillsCtx}`;
}