| 1528 | - Do not call completion tools just to be polite; only call them when the state is real. |
| 1529 | - Do not ask the user questions unless blocked; make reasonable assumptions and continue. |
| 1530 | - Follow safety rules: no destructive commands, force pushes, production deploys, production database resets, or deleting user data. |
| 1531 | |
| 1532 | ${sections.join(` |
| 1533 | |
| 1534 | --- |
| 1535 | |
| 1536 | `)}`; |
| 1537 | } |
| 1538 | |
| 1539 | // src/source/runtime/goal-runtime.js |
| 1540 | function pickGoalJob(state, target = "") { |
| 1541 | const goals = (state.jobs || []).filter(isGoalJob); |
| 1542 | if (!goals.length) |
| 1543 | return; |
| 1544 | const text = String(target || "").trim(); |
| 1545 | if (!text || ["active", "current", "goal"].includes(text.toLowerCase())) |
| 1546 | return goals.find((job) => job.goalStatus === "active" && job.enabled !== false) || goals[0]; |
| 1547 | return goals.find((job, index) => matchJob(job, text, index)); |
| 1548 | } |
| 1549 | function parseGoalToolText(args, fields) { |
| 1550 | const result = {}; |