core / prompts.py

System-prompt templates and per-budget thinking instructions.

Templates

ConstantUse
SYSTEM_PROMPT (line 231)Main identity, persona rules, anti-hallucination guard, tool-use protocol.
SPECIALIST_SYSTEM_PROMPT (line 274)DBA / SWE specialist mode — strict observability ("print everything").
QWEN_TOOL_PROMPT (line 172)Qwen-specific XML tool-call syntax with CDATA escape hatch for < / >.
THINK_BUDGET_TIGHT (line 116)≤5 sentences; no brainstorming alternatives.
THINK_BUDGET_EXTENDED (line 130)~15 sentences for debugging / SQL / algorithm work; forbid drafting code in the think block.
THINK_BUDGET_SELFPLAY (line 158)≤6 bullet points for fast bounded self-play exercises.

Helpers

FunctionPurpose
build_project_briefing(store, project_id, max_events=3, max_open_tasks=8) -> strRender a multi-line project context block — open tasks, recent events, current goal — for prompt injection (line 4).

Tool-orchestration routing rules (SYSTEM_PROMPT)

A block of MANDATORY TRIGGERS in SYSTEM_PROMPT maps user intents to specific tool calls so the LLM doesn't improvise. Current rules include:

Self-play challenge-gen hardening (SYNTHETIC_CHALLENGE_PROMPT)

The challenge-generation system prompt carries explicit rules to prevent LLM-generated validators from being unwinnable:

When FrontierTracker reports all clusters saturated, the dream loop additionally injects a CURRICULUM DIVERSITY REQUIREMENT block telling the generator to pick from {concurrency, algo, regex_parse, sql, bash} and forbidding another data-analysis / CSV-groupby shape.