W5.9 fix: case-writer timeout floor 300s -> 600s
Some checks failed
CI / Web — typecheck + lint + build (push) Failing after 28s
CI / Scripts — Python smoke (push) Failing after 5s
CI / Web — npm audit (push) Failing after 27s
CI / Retrieval — golden set (Recall@5 + MRR) (push) Failing after 4s

The enriched prompt (scenes + verbatim + anomalies + witnesses + Dupin
tensions + Sun-Tzu brief) produces a longer bilingual narrative. At 300s
the claude CLI timed out mid-generation (job 945c14f2 failed at 310s).
Raised the floor to 600s; reprocess then completed in 251s with a bolder
closer reflecting the strategic brief.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Luiz Gustavo 2026-05-25 02:07:01 -03:00
parent eca177b079
commit a46012c339

View file

@ -385,12 +385,15 @@ export async function runCaseWriter(task: CaseWriterTask): Promise<
const systemPrompt = await readFile(PROMPT_PATH, "utf-8");
const prompt = buildPrompt(task, scenes, evidence, witnesses, gaps, tensions, brief, lang);
// Case-writer wants more output budget than the other detectives.
// Case-writer wants more time + budget than the other detectives. The
// enriched prompt (scenes + verbatim + anomalies + witnesses + tensions +
// strategic brief) produces a long bilingual narrative; 300s was too tight
// and timed out at the claude CLI. Floor at 600s.
const llm = await callClaude({
prompt, systemPrompt,
model: env.CLAUDE_MODEL,
allowedTools: [],
timeoutMs: Math.max(env.JOB_TIMEOUT_SECONDS, 240) * 1000,
timeoutMs: Math.max(env.JOB_TIMEOUT_SECONDS, 600) * 1000,
budgetCapUsd: task.budget_cap_usd ?? Math.max(env.BUDGET_CAP_USD_PER_JOB, 0.50),
});
await audit({