"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WORKFLOW_CONTINUATION_GUIDANCE = void 0;
exports.asPromptBullet = asPromptBullet;
exports.WORKFLOW_CONTINUATION_GUIDANCE = {
    inspectableUnknowns: "Do not ask humans to resolve inspectable facts. Inspect accessible repository/workspace state, tracker state, command output, logs, local and online docs, available skills/SKILL.md guidance, available MCP resources/tools, permitted web/network research, and permitted APIs before planning humanHandoffWhen or returning wait_human(question).",
    planInspectableUnknowns: "Turn inspectable unknowns into investigation or verification step instructions and observable doneWhen evidence; do not put them in humanHandoffWhen.",
    executeInspectableUnknowns: 'Resolve inspectable unknowns inside the current step when its boundary allows it. If inspected evidence proves the step doneWhen, return proceed; if the plan must change but work remains in this issue, use continuation.strategy="replan_same_issue"; if separate tracking is required, use continuation.strategy="spawn_child_issue".',
    humanJudgmentBoundary: "Use human handoff only when the remaining decision requires human preference, approval, credentials/permissions, unsafe or irreversible action, product or operational judgment, or external information unavailable to the worker.",
    humanHandoffBoundary: "Use humanHandoffWhen for ambiguity that remains after inspecting accessible evidence, approvals, credentials, unsafe operations, or product/operational judgment; do not hand off inspectable facts or independently trackable and fixable blockers by default.",
    executionGuidanceConflict: "Apply `executionGuidance` to the current step. If it conflicts with doneWhen, inspect accessible evidence first, then choose the narrowest path: spawn_child_issue for independently trackable blockers, replan_same_issue for same-issue plan changes, or wait_human(question) for human judgment.",
    executionContinuationBoundary: 'Use continuation.strategy="spawn_child_issue" only for blockers that prevent issue doneWhen, need their own objective/outputs/doneWhen, and have at least one separate-tracking reason such as independent deliverable, evidence bundle, review/integration boundary, materially different responsibility area, likely multiple AI cycles, env/data/review/reusable-skill work, or an out-of-scope but fixable verification failure after the current step implementation is complete. For continuation.strategy="spawn_child_issue", set continuation.title to a short user-visible child issue title and continuation.reason to the detailed blocker reason. Use continuation.strategy="replan_same_issue" when the current plan or step definitions cannot satisfy issue doneWhen but the remaining work still belongs in this issue. Use wait_human(question) only after accessible evidence has been inspected and the remaining decision requires human preference, approval, credentials, permissions, unsafe operations, product or operational judgment, or unavailable external information. Do not use follow-up or recurring schedule to cover unmet doneWhen or downstream phases still required by a broad goal contract; independent post-completion improvements belong in a follow-up seed, and cadence-based future runs belong in workflow schedule state. For skill blockers, start continuation.reason with "Skill resolution required:" and include capability, why not inline, alpaca capability list/search comparison, final alpaca skill list refs after the skill path remains best, source choice/approval needs, deps/auth/login, help/version/smoke verification, requires.skills update from usable refs, and alpaca workflow lint. For MCP blockers, include capability, alpaca capability list/search comparison, why MCP remains best, alpaca mcp list/search/catalog evidence, safe install or human setup status, deps/auth/secrets/admin/permissions, alpaca mcp verify --ref <ref>, any requires.mcp update, and alpaca workflow lint; keep continuation.title short and omit objective/outputs/doneWhen details.',
    finalStepBoundary: "Before final-step proceed, compare the latest user instruction, original issue, executionContract, inspected evidence, and result. If issue-level doneWhen is unmet or a broad goal contract still requires downstream phases, use replan_same_issue for same-issue plan changes, spawn_child_issue for independently trackable blockers, or wait_human(question) only for human judgment; workflow_closing will decide final review and independent post-completion follow-up.",
    replanSameIssue: 'Use continuation.strategy="replan_same_issue" only when the current plan or step definitions cannot satisfy parent issue doneWhen and same-issue replanning is enough.',
    spawnChildIssue: 'Use continuation.strategy="spawn_child_issue" only when a blocker prevents parent issue doneWhen, needs its own objective, outputs, doneWhen/checks, and has at least one separate-tracking reason such as independent deliverable, evidence bundle, review/integration boundary, materially different responsibility area, likely multiple AI cycles, or out-of-scope but fixable verification failure.',
};
function asPromptBullet(text) {
    return `- ${text}`;
}
