"""Routing questions sent to Laya in one forward pass. ``choice`` is used for task level because Laya's ordinal ``score`` primitive is the weakest of the three. Bump the matching version when the wording changes so logged decisions stay interpretable. """ from __future__ import annotations QUESTIONS_VERSION = "1" POST_TOOL_VERSION = "1" PRE_EDIT_VERSION = "1" GATE_VERSION = "1" STOP_VERSION = "1" SKILL_VERSION = "1" PROMPT_QUESTIONS: dict = { "task_level": { "type": "choice", "instructions": ( "Classify the complexity of this software engineering request." ), "criteria": { "simple": ( "Small isolated task. Explanation, lookup, tiny code change, " "simple syntax fix, or obvious bug." ), "normal": ( "Normal engineering task. Requires reading several files, " "implementing a feature, debugging, refactoring, or several steps." ), "complex": ( "Complex engineering task. Architecture design, difficult debugging, " "cross-module change, unfamiliar system, performance investigation, " "large refactor, or substantial reasoning." ), }, }, "needs_plan": { "type": "noul", "instructions": ( "Should the coding agent make a plan before implementing this request?" ), }, "needs_repo": { "type": "noul", "instructions": ( "Does this request require inspecting multiple files or understanding " "the existing repository before answering?" ), }, "needs_web": { "type": "noul", "instructions": ( "Does this request likely require current external documentation, " "library documentation, APIs, or web research?" ), }, "needs_deep_reasoning": { "type": "noul", "instructions": ( "Does this software engineering request require substantial reasoning, " "architecture analysis, difficult debugging, or evaluating tradeoffs?" ), }, } POST_TOOL_QUESTIONS: dict = { "is_stuck": { "type": "noul", "instructions": ( "Is the coding agent stuck: repeating itself, looping on the same " "error, or making no progress on the user's request?" ), }, "should_replan": { "type": "noul", "instructions": ( "Should the coding agent stop editing and make a new plan before " "the next change?" ), }, "needs_more_context": { "type": "noul", "instructions": ( "Does the agent need to read more of the repository before it can " "safely continue?" ), }, } PRE_EDIT_QUESTIONS: dict = { "edit_premature": { "type": "noul", "instructions": ( "Is the agent about to edit code it has not understood yet, without " "reading the relevant file or its callers?" ), }, } GATE_QUESTIONS: dict = { "destructive": { "type": "noul", "instructions": ( "Would this tool call delete data, overwrite unrelated files, wipe " "history, or otherwise destroy work?" ), }, "irreversible": { "type": "noul", "instructions": ( "Is this tool call hard to undo, such as a force push, a published " "release, dropping a database, or sending a message?" ), }, "touches_secrets_or_prod": { "type": "noul", "instructions": ( "Does this tool call read or write secrets, credentials, production " "configuration, or a production system?" ), }, } STOP_QUESTIONS: dict = { "claims_done_without_verification": { "type": "noul", "instructions": ( "Is the agent claiming the task is finished even though the edited " "code has not been verified by a test, build, or typecheck?" ), }, "task_incomplete": { "type": "noul", "instructions": ( "Is the user's request still unfinished in the work shown here?" ), }, } # Backward-compatible alias used by the prompt route and the warmup call. QUESTIONS: dict = PROMPT_QUESTIONS