fix(prompts): v3 — wider maxLength budgets for Turkish output
v2 prompts hit schema validation failures on Turkish output (quick_fix, friction_point, suggested_action commonly exceeded 300 chars). Turkish is naturally ~15-20% longer than English. Widened limits across all 7 schemas: - title: 120 → 140 - *hypothesis*: 500 → 700 - friction_point / quick_fix / suggested_action: 300 → 500 - long_term_fix: 500 → 800 - block_point / unclear_concept / documentation_gap / suggested_in_app_help: 200/unbounded → 400 - feature_gap_hypothesis / suggested_intervention: 300 → 500 - pattern_bundle root_cause_hypothesis: 600 → 800 - business_impact_estimate / user_impact_estimate: 300 → 300-500 - affected_component_hypothesis: unbounded → 400 - error_signature: unbounded → 300 - pattern_name: 80 → 100 - priority_recommendation: 200 → 300 SASE_CONTEXT output rules clarified — schema enforces per-field maxLength. v2 → v3 across all 7 templates. seed-runtime auto-deactivates v2 on next worker boot. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -26,7 +26,7 @@ const SASE_CONTEXT = `Sase.tr context:
|
||||
Output rules:
|
||||
- Return ONLY valid JSON matching the schema. No markdown, no code fences, no preamble.
|
||||
- If you are uncertain, lower the confidence; do not invent specifics.
|
||||
- All string fields are concise (titles ≤120 chars, hypothesis ≤500 chars).
|
||||
- All string fields are concise. Schema enforces per-field maxLength (titles ≤140; hypothesis/long_term_fix ≤700-800; other prose ≤400-500). Stay within limits; truncate if needed.
|
||||
- **Tüm metin alanlarını TÜRKÇE yaz** (title, hypothesis, reproduce_steps, quick_fix, long_term_fix, friction_point, intent_hypothesis, suggested_action, suggested_investigation, error_signature description, block_point, unclear_concept, documentation_gap, suggested_in_app_help, vb.). Sadece enum/const/teknik tanımlayıcı alanlar İngilizce kalır (örn. severity: "P0"|"P1"|..., type: "bug"|..., friction_type: "copy"|"layout"|..., failure_mode: "timeout"|..., implicated_provider: "PL24"|"PCAT"|...).
|
||||
- Türkçe yazarken doğal, net, eyleme dönüştürülebilir cümleler kur. Teknik terimleri (route, component, endpoint, provider, fingerprint) Türkçe gloss'lamadan kullan: "/dashboard/search route'unda...", "VinLookupController component'inde...".`;
|
||||
|
||||
@@ -36,16 +36,16 @@ const BUG_TRIAGE_SCHEMA = {
|
||||
properties: {
|
||||
type: { const: "bug" },
|
||||
severity: { enum: ["P0", "P1", "P2", "P3"] },
|
||||
title: { type: "string", maxLength: 120 },
|
||||
title: { type: "string", maxLength: 140 },
|
||||
reproduce_steps: { type: "array", items: { type: "string" }, minItems: 2, maxItems: 10 },
|
||||
affected_route: { type: "string" },
|
||||
affected_component_hypothesis: { type: "string" },
|
||||
error_signature: { type: "string" },
|
||||
hypothesis: { type: "string", maxLength: 500 },
|
||||
affected_component_hypothesis: { type: "string", maxLength: 400 },
|
||||
error_signature: { type: "string", maxLength: 300 },
|
||||
hypothesis: { type: "string", maxLength: 700 },
|
||||
suggested_investigation: { type: "array", items: { type: "string" } },
|
||||
suggested_fix_effort: { enum: ["S", "M", "L"] },
|
||||
confidence: { type: "number", minimum: 0, maximum: 1 },
|
||||
user_impact_estimate: { type: "string" },
|
||||
user_impact_estimate: { type: "string", maxLength: 300 },
|
||||
is_likely_provider_issue: { type: "boolean" },
|
||||
implicated_provider: { enum: ["PL24", "PCAT", "RMEX", "TecDoc", null] },
|
||||
},
|
||||
@@ -57,12 +57,12 @@ const UX_FRICTION_SCHEMA = {
|
||||
properties: {
|
||||
type: { const: "ux_friction" },
|
||||
severity: { enum: ["P1", "P2", "P3"] },
|
||||
title: { type: "string", maxLength: 120 },
|
||||
intent_hypothesis: { type: "string", maxLength: 300 },
|
||||
friction_point: { type: "string", maxLength: 300 },
|
||||
title: { type: "string", maxLength: 140 },
|
||||
intent_hypothesis: { type: "string", maxLength: 500 },
|
||||
friction_point: { type: "string", maxLength: 500 },
|
||||
friction_type: { enum: ["copy", "layout", "affordance", "performance", "terminology", "discoverability"] },
|
||||
quick_fix: { type: "string", maxLength: 300 },
|
||||
long_term_fix: { type: "string", maxLength: 500 },
|
||||
quick_fix: { type: "string", maxLength: 500 },
|
||||
long_term_fix: { type: "string", maxLength: 800 },
|
||||
affected_user_segment: { type: "string" },
|
||||
confidence: { type: "number", minimum: 0, maximum: 1 },
|
||||
},
|
||||
@@ -74,12 +74,12 @@ const PAYMENT_SCHEMA = {
|
||||
properties: {
|
||||
type: { const: "payment" },
|
||||
severity: { enum: ["P0", "P1", "P2"] },
|
||||
title: { type: "string", maxLength: 120 },
|
||||
title: { type: "string", maxLength: 140 },
|
||||
failure_mode: { enum: ["ui_silent", "backend_decline", "user_abandoned", "checkout_friction", "validation_failed", "trial_to_paid_lost"] },
|
||||
hypothesis: { type: "string", maxLength: 500 },
|
||||
hypothesis: { type: "string", maxLength: 700 },
|
||||
payment_method_hint: { type: "string" },
|
||||
suggested_investigation: { type: "array", items: { type: "string" } },
|
||||
business_impact_estimate: { type: "string" },
|
||||
business_impact_estimate: { type: "string", maxLength: 400 },
|
||||
confidence: { type: "number", minimum: 0, maximum: 1 },
|
||||
},
|
||||
};
|
||||
@@ -90,12 +90,12 @@ const ONBOARDING_SCHEMA = {
|
||||
properties: {
|
||||
type: { const: "onboarding" },
|
||||
severity: { enum: ["P1", "P2", "P3"] },
|
||||
title: { type: "string", maxLength: 120 },
|
||||
block_point: { type: "string", maxLength: 200 },
|
||||
unclear_concept: { type: "string" },
|
||||
documentation_gap: { type: "string" },
|
||||
suggested_in_app_help: { type: "string" },
|
||||
hypothesis: { type: "string", maxLength: 500 },
|
||||
title: { type: "string", maxLength: 140 },
|
||||
block_point: { type: "string", maxLength: 400 },
|
||||
unclear_concept: { type: "string", maxLength: 400 },
|
||||
documentation_gap: { type: "string", maxLength: 400 },
|
||||
suggested_in_app_help: { type: "string", maxLength: 400 },
|
||||
hypothesis: { type: "string", maxLength: 700 },
|
||||
confidence: { type: "number", minimum: 0, maximum: 1 },
|
||||
},
|
||||
};
|
||||
@@ -106,14 +106,14 @@ const UPGRADE_SCHEMA = {
|
||||
properties: {
|
||||
type: { const: "conversion" },
|
||||
severity: { enum: ["P1", "P2", "P3"] },
|
||||
title: { type: "string", maxLength: 120 },
|
||||
title: { type: "string", maxLength: 140 },
|
||||
viewed_tier: { type: "string" },
|
||||
time_on_pricing_seconds: { type: "number" },
|
||||
comparison_signals: { type: "boolean" },
|
||||
likely_concern: { enum: ["price", "feature", "trust", "unclear", "wrong_tier", "other"] },
|
||||
feature_gap_hypothesis: { type: "string", maxLength: 300 },
|
||||
suggested_intervention: { type: "string", maxLength: 300 },
|
||||
hypothesis: { type: "string", maxLength: 500 },
|
||||
feature_gap_hypothesis: { type: "string", maxLength: 500 },
|
||||
suggested_intervention: { type: "string", maxLength: 500 },
|
||||
hypothesis: { type: "string", maxLength: 700 },
|
||||
confidence: { type: "number", minimum: 0, maximum: 1 },
|
||||
},
|
||||
};
|
||||
@@ -124,12 +124,12 @@ const BUNDLE_SCHEMA = {
|
||||
properties: {
|
||||
type: { const: "pattern" },
|
||||
severity: { enum: ["P0", "P1", "P2", "P3"] },
|
||||
title: { type: "string", maxLength: 120 },
|
||||
pattern_name: { type: "string", maxLength: 80 },
|
||||
root_cause_hypothesis: { type: "string", maxLength: 600 },
|
||||
title: { type: "string", maxLength: 140 },
|
||||
pattern_name: { type: "string", maxLength: 100 },
|
||||
root_cause_hypothesis: { type: "string", maxLength: 800 },
|
||||
affected_user_count: { type: "integer" },
|
||||
business_impact_estimate: { type: "string", maxLength: 300 },
|
||||
priority_recommendation: { type: "string", maxLength: 200 },
|
||||
business_impact_estimate: { type: "string", maxLength: 500 },
|
||||
priority_recommendation: { type: "string", maxLength: 300 },
|
||||
confidence: { type: "number", minimum: 0, maximum: 1 },
|
||||
},
|
||||
};
|
||||
@@ -140,11 +140,11 @@ const PROVIDER_SCHEMA = {
|
||||
properties: {
|
||||
type: { const: "provider_quality" },
|
||||
severity: { enum: ["P1", "P2", "P3"] },
|
||||
title: { type: "string", maxLength: 120 },
|
||||
title: { type: "string", maxLength: 140 },
|
||||
affected_provider: { enum: ["PL24", "PCAT", "RMEX", "TecDoc", "multi"] },
|
||||
failure_mode: { enum: ["timeout", "incomplete_data", "wrong_data", "auth_error", "ratelimit", "unknown"] },
|
||||
hypothesis: { type: "string", maxLength: 500 },
|
||||
suggested_action: { type: "string", maxLength: 300 },
|
||||
hypothesis: { type: "string", maxLength: 700 },
|
||||
suggested_action: { type: "string", maxLength: 500 },
|
||||
confidence: { type: "number", minimum: 0, maximum: 1 },
|
||||
},
|
||||
};
|
||||
@@ -152,8 +152,8 @@ const PROVIDER_SCHEMA = {
|
||||
export const SEED_PROMPTS: PromptTemplate[] = [
|
||||
{
|
||||
tag: "bug_triage",
|
||||
version: 2,
|
||||
name: "Bug Triage v2 (TR)",
|
||||
version: 3,
|
||||
name: "Bug Triage v3 (TR, ext maxLen)",
|
||||
systemPrompt: `You analyze bugs found in user sessions of a B2B SaaS. Extract reproducible steps, locate the failing component, and propose a hypothesis.
|
||||
|
||||
${SASE_CONTEXT}
|
||||
@@ -170,8 +170,8 @@ This session contains a bug. Return JSON per the schema.`,
|
||||
},
|
||||
{
|
||||
tag: "ux_friction",
|
||||
version: 2,
|
||||
name: "UX Friction v2 (TR)",
|
||||
version: 3,
|
||||
name: "UX Friction v3 (TR, ext maxLen)",
|
||||
systemPrompt: `You are a senior UX engineer. Given a session timeline, identify where the user got stuck and propose a quick fix and a long-term fix.
|
||||
|
||||
${SASE_CONTEXT}
|
||||
@@ -188,8 +188,8 @@ Return JSON per the schema.`,
|
||||
},
|
||||
{
|
||||
tag: "payment_issue",
|
||||
version: 2,
|
||||
name: "Payment Issue v2 (TR)",
|
||||
version: 3,
|
||||
name: "Payment Issue v3 (TR, ext maxLen)",
|
||||
systemPrompt: `You analyze payment/conversion failures in a B2B SaaS. Identify failure mode and likely cause.
|
||||
|
||||
${SASE_CONTEXT}
|
||||
@@ -206,8 +206,8 @@ Return JSON per the schema.`,
|
||||
},
|
||||
{
|
||||
tag: "onboarding_stuck",
|
||||
version: 2,
|
||||
name: "Onboarding Stuck v2 (TR)",
|
||||
version: 3,
|
||||
name: "Onboarding Stuck v3 (TR, ext maxLen)",
|
||||
systemPrompt: `You analyze new-user onboarding sessions where the user did not reach first value. Propose where they got stuck and what help is missing.
|
||||
|
||||
${SASE_CONTEXT}
|
||||
@@ -224,8 +224,8 @@ Return JSON per the schema.`,
|
||||
},
|
||||
{
|
||||
tag: "upgrade_hesitation",
|
||||
version: 2,
|
||||
name: "Upgrade Hesitation v2 (TR)",
|
||||
version: 3,
|
||||
name: "Upgrade Hesitation v3 (TR, ext maxLen)",
|
||||
systemPrompt: `You analyze sessions where a user reached the pricing/upgrade page but did not convert. Identify likely concern (price/feature/trust) and propose intervention.
|
||||
|
||||
${SASE_CONTEXT}
|
||||
@@ -242,8 +242,8 @@ Return JSON per the schema.`,
|
||||
},
|
||||
{
|
||||
tag: "pattern_bundle",
|
||||
version: 2,
|
||||
name: "Pattern Bundle v2 (TR)",
|
||||
version: 3,
|
||||
name: "Pattern Bundle v3 (TR, ext maxLen)",
|
||||
systemPrompt: `You are given an aggregate timeline that bundles 3+ user sessions sharing the same fingerprint (similar tags, route, and error signature). Synthesize the cross-session pattern and recommend priority.
|
||||
|
||||
${SASE_CONTEXT}
|
||||
@@ -264,8 +264,8 @@ Return JSON per the schema. Use occurrence patterns from the bundle summary to e
|
||||
},
|
||||
{
|
||||
tag: "provider_quality",
|
||||
version: 2,
|
||||
name: "Provider Quality v2 (TR)",
|
||||
version: 3,
|
||||
name: "Provider Quality v3 (TR, ext maxLen)",
|
||||
systemPrompt: `You analyze upstream provider failures (PL24/PCAT/RMEX/TecDoc) impacting Sase.tr users. Identify which provider failed and propose action.
|
||||
|
||||
${SASE_CONTEXT}
|
||||
|
||||
Reference in New Issue
Block a user