feat(llm,issues): Türkçe çıktı — prompt v2 + Gitea issue body Türkçe başlıklar

apps/worker/src/lib/prompts.ts:
- SASE_CONTEXT'e Türkçe çıktı kuralı eklendi (tüm doğal dil alanları Türkçe,
  enum/const/teknik tanımlayıcılar İngilizce kalır)
- 7 seed prompt v2'ye bump edildi (bug_triage, ux_friction, payment_issue,
  onboarding_stuck, upgrade_hesitation, pattern_bundle, provider_quality)
- name suffix "v2 (TR)"

apps/worker/src/lib/seed-runtime.ts:
- Yeni version insert ederken, aynı tag'in eski active versiyonlarını otomatik
  deactivate eder (publishPromptVersion ile aynı davranış)

apps/web/src/lib/gitea.ts (buildIssueBody):
- Tüm bölüm başlıkları Türkçe: Bağlam, Hipotez, Kullanıcı niyeti, Friction
  noktası, Tekrarlama adımları, Etkilenen alan, Hata imzası, Şüpheli provider,
  Hata modu, Hızlı çözüm, Uzun vadeli çözüm, Önerilen aksiyon, Araştırma
  önerisi, Tıkanma noktası, Anlaşılmayan kavram, Dokümantasyon eksiği,
  Önerilen in-app yardım, Tahmini efor, Kanıt, Definition of Done
- Önem/Tekrar/İlk/Son görüldü etiketleri

Sonraki analyze döngüsü itibarıyla yeni insight'ların metin alanları Türkçe.
Mevcut insight #cmp4o*, #cmp5e* (v1 ile üretilmiş) değişmez.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Semih
2026-05-16 10:45:43 +03:00
parent f93cabb932
commit 752e69cd01
4 changed files with 55 additions and 48 deletions

View File

@@ -157,71 +157,71 @@ export function buildIssueBody(opts: {
}): string {
const b = opts.body;
const lines: string[] = [
`## Context (insight-driven)`,
`## Bağlam (insight kaynaklı)`,
``,
`- **Insight ID:** \`${opts.insightId}\``,
`- **Type:** ${opts.type}`,
`- **Severity:** ${opts.severity}`,
`- **Occurrences:** ${opts.occurrenceCount} session${opts.occurrenceCount === 1 ? "" : "s"}, ${opts.uniqueUserCount} user${opts.uniqueUserCount === 1 ? "" : "s"}`,
`- **First seen:** ${opts.firstSeenAt.toISOString().slice(0, 10)}`,
`- **Last seen:** ${opts.lastSeenAt.toISOString().slice(0, 10)}`,
`- **AI confidence:** ${opts.confidence?.toFixed(2) ?? "—"}`,
`- **Tür:** ${opts.type}`,
`- **Önem:** ${opts.severity}`,
`- **Tekrar:** ${opts.occurrenceCount} oturum, ${opts.uniqueUserCount} kullanıcı`,
`- **İlk görüldü:** ${opts.firstSeenAt.toISOString().slice(0, 10)}`,
`- **Son görüldü:** ${opts.lastSeenAt.toISOString().slice(0, 10)}`,
`- **AI güven:** ${opts.confidence?.toFixed(2) ?? "—"}`,
`- **Model:** ${opts.model}`,
``,
];
if (typeof b.hypothesis === "string") lines.push(`## Hypothesis`, b.hypothesis as string, "");
if (typeof b.intent_hypothesis === "string") lines.push(`## User intent`, b.intent_hypothesis as string, "");
if (typeof b.friction_point === "string") lines.push(`## Friction point`, b.friction_point as string, "");
if (typeof b.hypothesis === "string") lines.push(`## Hipotez`, b.hypothesis as string, "");
if (typeof b.intent_hypothesis === "string") lines.push(`## Kullanıcı niyeti`, b.intent_hypothesis as string, "");
if (typeof b.friction_point === "string") lines.push(`## Friction noktası`, b.friction_point as string, "");
if (Array.isArray(b.reproduce_steps) && b.reproduce_steps.length) {
lines.push(`## Reproduce steps`);
lines.push(`## Tekrarlama adımları`);
(b.reproduce_steps as string[]).forEach((s, i) => lines.push(`${i + 1}. ${s}`));
lines.push("");
}
if (typeof b.affected_route === "string" || typeof b.affected_component_hypothesis === "string") {
lines.push(`## Affected`);
lines.push(`## Etkilenen alan`);
if (b.affected_route) lines.push(`- Route: \`${b.affected_route}\``);
if (b.affected_component_hypothesis) lines.push(`- Component: ${b.affected_component_hypothesis}`);
lines.push("");
}
if (typeof b.error_signature === "string") {
lines.push(`## Error signature`, "```", b.error_signature as string, "```", "");
lines.push(`## Hata imzası`, "```", b.error_signature as string, "```", "");
}
if (typeof b.affected_provider === "string" || typeof b.implicated_provider === "string") {
lines.push(`## Implicated provider`, `${b.affected_provider ?? b.implicated_provider}`, "");
lines.push(`## Şüpheli provider`, `${b.affected_provider ?? b.implicated_provider}`, "");
}
if (typeof b.failure_mode === "string") lines.push(`## Failure mode`, `${b.failure_mode}`, "");
if (typeof b.quick_fix === "string") lines.push(`## Quick fix`, b.quick_fix as string, "");
if (typeof b.long_term_fix === "string") lines.push(`## Long-term fix`, b.long_term_fix as string, "");
if (typeof b.suggested_action === "string") lines.push(`## Suggested action`, b.suggested_action as string, "");
if (typeof b.failure_mode === "string") lines.push(`## Hata modu`, `${b.failure_mode}`, "");
if (typeof b.quick_fix === "string") lines.push(`## Hızlı çözüm`, b.quick_fix as string, "");
if (typeof b.long_term_fix === "string") lines.push(`## Uzun vadeli çözüm`, b.long_term_fix as string, "");
if (typeof b.suggested_action === "string") lines.push(`## Önerilen aksiyon`, b.suggested_action as string, "");
if (Array.isArray(b.suggested_investigation) && b.suggested_investigation.length) {
lines.push(`## Suggested investigation`);
lines.push(`## Araştırma önerisi`);
(b.suggested_investigation as string[]).forEach((s) => lines.push(`- ${s}`));
lines.push("");
}
if (typeof b.block_point === "string") lines.push(`## Block point`, b.block_point as string, "");
if (typeof b.unclear_concept === "string") lines.push(`## Unclear concept`, b.unclear_concept as string, "");
if (typeof b.documentation_gap === "string") lines.push(`## Documentation gap`, b.documentation_gap as string, "");
if (typeof b.suggested_in_app_help === "string") lines.push(`## Suggested in-app help`, b.suggested_in_app_help as string, "");
if (typeof b.block_point === "string") lines.push(`## Tıkanma noktası`, b.block_point as string, "");
if (typeof b.unclear_concept === "string") lines.push(`## Anlaşılmayan kavram`, b.unclear_concept as string, "");
if (typeof b.documentation_gap === "string") lines.push(`## Dokümantasyon eksiği`, b.documentation_gap as string, "");
if (typeof b.suggested_in_app_help === "string") lines.push(`## Önerilen in-app yardım`, b.suggested_in_app_help as string, "");
if (typeof b.suggested_fix_effort === "string") {
lines.push(`**Effort estimate:** ${b.suggested_fix_effort}`, "");
lines.push(`**Tahmini efor:** ${b.suggested_fix_effort}`, "");
}
lines.push(
`## Evidence`,
`## Kanıt`,
``,
`- Panel link: ${opts.panelUrl}/insights/i/${opts.insightId}`,
...opts.relatedSessionIds.slice(0, 5).map(
(sid) => `- Session: ${opts.panelUrl}/insights/sessions/${sid}`,
(sid) => `- Oturum: ${opts.panelUrl}/insights/sessions/${sid}`,
),
``,
`## Definition of Done`,
``,
`- [ ] Fix deployed`,
`- [ ] Validation period (14 days) clean (no regression)`,
`- [ ] Fix deploy edildi`,
`- [ ] Validation periyodu (14 gün) regresyonsuz geçti`,
``,
`---`,
`*Generated by Süper Panel insight pipeline. Insight #${opts.insightId.slice(0, 8)}.*`,
`*Süper Panel insight pipeline tarafından üretildi. Insight #${opts.insightId.slice(0, 8)}.*`,
);
return lines.join("\n");