You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: per-archetype PremortemTask decomposition for small-model compatibility
PremortemAnalysis required the LLM to emit a deeply nested schema in one call:
3 AssumptionItem + 3 FailureModeItem, 11+ required fields each, with linked
cross-reference IDs. Local small models (Qwen 3.5-35B, GLM 4.7 Flash) echoed
the schema structure back instead of producing values, exhausting all retries.
Fix: decompose into one independent LLM call per archetype using ArchetypeNarrative
(6 plain text fields, no IDs). Code assembles AssumptionItem + FailureModeItem
from the narrative and assigns all IDs and cross-references.
Changes (3 hunks):
1. Add ArchetypeNarrative schema (after PremortemAnalysis). Includes an 'archetype'
field so the LLM can adapt the category name to the specific project rather than
being locked to hardcoded labels.
2. Rewrite execute() to run num_rounds × 3 archetypes (3×3=9 calls in ALL_DETAILS,
1×3=3 in FAST mode), restoring the original 9+9 assumption/failure-mode volume.
Archetype suggestions guide the LLM; the returned narrative.archetype is used in
the output (LLM may rename/adapt it per project).
Failed archetype calls are skipped gracefully; first call failure raises.
3. Fix _calculate_risk_level_verbose: return 'Not Scored' when likelihood or
impact is None (was rendering 'Likelihood None/5, Impact None/5').
Validated: PremortemTask PASSED on GLM 4.7 Flash (HVT_minimal run).
Copy file name to clipboardExpand all lines: worker_plan/worker_plan_internal/diagnostics/premortem.py
+66-65Lines changed: 66 additions & 65 deletions
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,15 @@ class PremortemAnalysis(BaseModel):
71
71
assumptions_to_kill: List[AssumptionItem] =Field(description="A list of 3 new, critical, underlying assumptions to test immediately.")
72
72
failure_modes: List[FailureModeItem] =Field(description="A list containing exactly 3 distinct failure failure_modes, one for each archetype.")
73
73
74
+
classArchetypeNarrative(BaseModel):
75
+
"""Minimal per-archetype schema. IDs and cross-references are assigned by the program, not the LLM."""
76
+
archetype: str=Field(description="The failure archetype category most relevant to this project and scenario (e.g. 'Process/Financial', 'Technical/Logistical', 'Market/Human', or a more specific variant).")
77
+
assumption: str=Field(description="One critical assumption the project is making that, if false, would cause this failure.")
78
+
test_now: str=Field(description="One concrete action to immediately test if this assumption holds.")
79
+
failure_title: str=Field(description="A short, compelling title for this failure scenario (e.g. 'The Gridlock Gamble').")
80
+
failure_story: str=Field(description="A detailed narrative of how this failure unfolds. Explain causes, chain of events, and impact.")
81
+
warning_signs: List[str] =Field(description="2-4 observable signals that this failure is beginning to occur.")
82
+
74
83
PREMORTEM_SYSTEM_PROMPT="""
75
84
Persona: You are a senior project analyst. Your primary goal is to write compelling, detailed, and distinct failure stories that are also operationally actionable.
0 commit comments