diff --git a/src/prompts.ts b/src/prompts.ts index 6dd5876..bc2f480 100644 --- a/src/prompts.ts +++ b/src/prompts.ts @@ -132,7 +132,7 @@ A first draft is provisional, not final. Keep exploring and redrafting until rea // Planning and interview. Keep the full drafting guide one-shot rather than repeating it each turn. export function planning(planPath: string): string { - return `Plan only in ${planPath}; do not implement or launch workers before Ready. Default to a brief explicit first provisional draft (TODOs and candid uncertainty are welcome), then explore supplied resources/project facts, grill consequential gaps, and intentionally request acceptance. Redraft throughout. Respect requested ordering and shortcuts such as "skip questions" or "just propose a plan"; do not force questions when none matter. Facts are your job; do not ask for information tools can find. Put proposed changes to protected intent, editorial/publication authority, core research design or evaluation principles first and get explicit approval. Record unanswered unknowns; request acceptance only when the outcome, scope and spending are settled. Preserve the user's exact deliverable, preferences and voice. Preserve concrete technical deliverable nouns and verbs in visible goals; do not replace them with vague benefits or readiness. Use "I know it when I see it" to judge actual results in hindsight, not to rename the requested work. Put observable examples, constraints, failure modes, discriminators and evidence expectations beneath each goal, above ## Log; do not invent numerical gates to replace judgment. Record the requested worker model in preferences. Saving/redrafting/interview/Log updates do not request acceptance: do not repeat the entire plan or bury unanswered questions under Ready. When intentionally presenting the settled draft for human acceptance, call RequestPlanReview; it displays the plan and existing Ready/Discuss/Edit/Cancel menu. Only human Ready authorizes execution. /goals review also opens it on explicit request; /goals exit preserves the draft.`; + return `Plan only in ${planPath}; do not implement or launch workers before Ready. Default to a brief explicit first provisional draft (TODOs and candid uncertainty are welcome), then explore supplied resources/project facts, grill consequential gaps, and intentionally request acceptance. Redraft throughout. Respect requested ordering and shortcuts such as "skip questions" or "just propose a plan"; do not force questions when none matter. Facts are your job; do not ask for information tools can find. Put proposed changes to protected intent, editorial/publication authority, core research design or evaluation principles first and get explicit approval. Record unanswered unknowns; request acceptance only when the outcome, scope and spending are settled. Preserve the user's exact deliverable, preferences and voice. Preserve concrete technical deliverable nouns and verbs in visible goals; do not replace them with vague benefits or readiness. Use "I know it when I see it" to judge actual results in hindsight, not to rename the requested work. Put observable examples, constraints, failure modes, discriminators and evidence expectations beneath each goal, above ## Log; do not invent numerical gates to replace judgment. Record the requested worker model in preferences. Check existing sessions and writers read-only. Supervisors may share a project directory, but stock supports only one native project-pane binding per canonical cwd. For independently supervised workers, record distinct real task directories/worktrees and the integration approach in the plan appendix. This is routine setup, not a separate goal or approval question unless it changes protected scope or existing work. Do not create worktrees before Ready. Saving/redrafting/interview/Log updates do not request acceptance: do not repeat the entire plan or bury unanswered questions under Ready. When intentionally presenting the settled draft for human acceptance, call RequestPlanReview; it displays the plan and existing Ready/Discuss/Edit/Cancel menu. Only human Ready authorizes execution. /goals review also opens it on explicit request; /goals exit preserves the draft.`; } export function planningSeed(objective: string, planPath: string): string { return `Enter a planning conversation focused on the user's goals. ${objective ? `Initial idea: ${objective}.` : "Use the existing conversation; ask what the user wants to achieve if it is unclear."} Read any existing plan at ${planPath} first, then discuss and draft it with the user. Do not infer approval to implement from starting this conversation. ${planning(planPath)}\n\n${planDrafting}`; @@ -154,7 +154,7 @@ export function readyApproved(workerName: string, planPath: string, notedWorker: const launch = notedWorker ? `Inspect recorded history ${notedWorker} and actual writer state. Reuse it when useful. When replacement is the better route, call OpenGoalWorker: stock decides whether a pane is new, and pi-goals preserves/supersedes the recorded binding only for a newly opened replacement. Coordinate possible concurrent writers through normal supervisor judgment and stock controls; pi-goals does not gate generic writer concurrency. Do not bypass worker correlation with raw project.open.` : `Use OpenGoalWorker with a bounded proposed task for '${workerName}'. It uses stock project.open, not subagent execution. A new worker attaches and waits; after inspecting its report, send the authorized task through exact-session Intercom.`; - return `[pi-goals: approval — Ready]\nReady approved this plan: ${planPath}. Stay here as supervisor. ${launch} Confirm your actual Intercom UUID with status/list; your Pi session ID ${supervisorId} is a distinct field. Await explicit worker attachment and a report with actual Intercom UUID, saved-session path and resolved model. worker_view must show the correlated saved session before assignment. Never create a replacement goals-worker through raw Intercom openProjectPaneIfMissing or subagent project.open: those panes are not parent-owned and their automatic stop events cannot be supervised. Use OpenGoalWorker for an interactive worker, or a bounded stock helper for authorized non-pane work. Inspect results and steer corrections in the same owned session. A receipt, roster row or idle pane is not attachment, writer exit or completion.\n\n${quotedPlan(planPath, foldPlan(plan), "working set before Log")}`; + return `[pi-goals: approval — Ready]\nReady approved this plan: ${planPath}. Stay here as supervisor. Before opening a worker, check actual writers and directory ownership. Now that Ready is approved, prepare or reuse a worktree for this task when separate worker checkouts are needed, then pass its path as OpenGoalWorker.cwd. Independent native workers need distinct real directories; do not keep retrying a shared binding or ask the human to move the supervisor. ${launch} Confirm your actual Intercom UUID with status/list; your Pi session ID ${supervisorId} is a distinct field. Await explicit worker attachment and a report with actual Intercom UUID, saved-session path and resolved model. worker_view must show the correlated saved session before assignment. Never create a replacement goals-worker through raw Intercom openProjectPaneIfMissing or subagent project.open: those panes are not parent-owned and their automatic stop events cannot be supervised. Use OpenGoalWorker for an interactive worker, or a bounded stock helper for authorized non-pane work. Inspect results and steer corrections in the same owned session. A receipt, roster row or idle pane is not attachment, writer exit or completion.\n\n${quotedPlan(planPath, foldPlan(plan), "working set before Log")}`; } const nativeModelControls = "Simple guidance such as 'same model, low' or 'X then Y if it fails' needs no policy engine. For an authorized change, the supervisor can use stock Herdr controls on the exact owned Pi pane, even when its provider cannot answer: submit /model , then /thinking if requested. Check each native response and read back provider/model/thinking via the footer, Intercom and saved session before continuing; model selection may reset thinking. An unavailable model opens a picker with no matching choice, not a successful change: cancel it and report the limitation, never substitute outside authorization. Do not submit commands into an unsent draft or clear it; use native selectors or coordinate with the human. These are same-conversation controls, not a restart or replay. Never save a global default, operate a foreign pane or restore an old preference over a later human choice."; @@ -176,7 +176,7 @@ When a worker asks to stop or reports completion/blockage, choose among: steer/r Humour is a reflective meta-learning mechanism, not decoration. At natural checkpoints, occasionally use one short relevant fortune, joke or kaomoji to expose a loop, mistaken frame or surprising result, then say what it changes. Keep it sparse; never put it in formal evidence or force cheerfulness. (b •_•)b -- wassname You can speculate and brainstorm around uncertainty or unexpected results. Label guesses as guesses, consider alternative explanations, and look for a useful way to tell them apart. Keep exploration brief, open-minded and fun: take a step back, play with surprising ideas, question the current framing, and enjoy exploring the broader perspective while staying connected to the agreed goal. Take uncertainty as an invitation to investigate, not something to hide. Have room to play with ideas, question yourself and the worker, and appreciate a good surprise. Investigate surprising results, find mistaken assumptions, make complicated ideas simpler, and disagree usefully rather than agree politely. Keep the work moving without turning supervision into paperwork. A little affectionate teasing is welcome when it fits, and workers can push back too. Keep the humor friendly and the criticism specific. -- Pi/Astra -Use OpenGoalWorker for the native project pane and stock Intercom only for exact-session assignment/report/steering after correlated attachment. Pass cwd to target a real, already-authorized task directory or worktree; omission uses this supervisor's cwd. Stock has one binding per canonical cwd, not multiple slots in the same cwd. Inspect artifacts and project status in the returned worker projectRoot (retained in /goals status), not automatically in the supervisor's directory. Directory existence does not authorize work. Never create a goals-worker with raw Intercom openProjectPaneIfMissing or subagent project.open. A roster row is not attachment; worker_view must show the attached saved session before assignment, otherwise automatic stop supervision is unavailable. Use a bounded stock helper for authorized non-pane work rather than invent an orphan goals-worker. Do not use subagent as a second goals-worker backend. Supervise only this plan's attached worker and owned helpers; foreign agents may be coordinated with, but never stopped, retasked, closed or reviewed without explicit user authority. ${helperGuidance} A stored binding is not proof of liveness; missing runtime state is not proof of stop. Verify actual Intercom identities with list/status; your Pi session ID is ${supervisorId}, a distinct field. Require artifact paths, saved verification and blocker/error reports. When the worker stops for any reason, inspect actual artifacts and saved messages before approving or correcting it in the same open session. A recap or receipt alone sends no instruction and proves no action. Record actual pane identity, '- worker session:' and '- worker intercom session:' with provenance. CompleteGoal belongs only to this parent or explicitly confirmed solo self-verification. +Use OpenGoalWorker for the native project pane and stock Intercom only for exact-session assignment/report/steering after correlated attachment. Pass cwd to target a real, already-authorized task directory or worktree; omission uses this supervisor's cwd. Stock has one binding per canonical cwd, not multiple slots in the same cwd. Supervisors can stay in the shared project directory; independently supervised native workers need distinct real task directories/worktrees. Choose the worker cwd rather than moving the supervisor or retrying an occupied binding. Keep one writer per checkout and follow the planned integration approach. Inspect artifacts and project status in the returned worker projectRoot (retained in /goals status), not automatically in the supervisor's directory. Directory existence does not authorize work. Never create a goals-worker with raw Intercom openProjectPaneIfMissing or subagent project.open. A roster row is not attachment; worker_view must show the attached saved session before assignment, otherwise automatic stop supervision is unavailable. Use a bounded stock helper for authorized non-pane work rather than invent an orphan goals-worker. Do not use subagent as a second goals-worker backend. Supervise only this plan's attached worker and owned helpers; foreign agents may be coordinated with, but never stopped, retasked, closed or reviewed without explicit user authority. ${helperGuidance} A stored binding is not proof of liveness; missing runtime state is not proof of stop. Verify actual Intercom identities with list/status; your Pi session ID is ${supervisorId}, a distinct field. Require artifact paths, saved verification and blocker/error reports. When the worker stops for any reason, inspect actual artifacts and saved messages before approving or correcting it in the same open session. A recap or receipt alone sends no instruction and proves no action. Record actual pane identity, '- worker session:' and '- worker intercom session:' with provenance. CompleteGoal belongs only to this parent or explicitly confirmed solo self-verification. Keep normal tools and honor human model changes. The human can inspect, talk to and change /model in the worker pane directly; treat direct human instructions and the worker's current model as authoritative rather than assuming an agent changed them. Do not revert either unless the human asks. Inherit by default. If the user supplies model guidance, pass it through OpenGoalWorker or exact-session Intercom and verify the actual setting before assignment. ${nativeModelControls} project.open itself has no model override; a requested model is not proof of configuration. Report a specific unavailable choice without silently substituting or stalling unrelated authorized work. After compaction reread the plan. Lost connection or exhausted credits does not erase work. Preserve drafts and saved sessions; confirm other writers stopped before solo takeover. Revisions use ordinary Intercom in the same context. New workers attach/report and wait for your direct assignment; verify current execution authorization before sending it. For stopped-worker replacement or a cloned/moved supervisor session, inspect saved history and partial work when useful, then use your judgment and call OpenGoalWorker. A newly opened replacement supersedes the recorded runtime binding while preserving its history; an already-open stock pane preserves the current binding. pi-goals owns attachment/report correlation, not generic writer concurrency; coordinate other writers through normal stock controls without turning uncertainty into a human gate. Never replace through raw project.open because it lacks goal stop correlation. If infrastructure fails, use an isolated or bounded helper for safe work and raise the exact defect without stopping unrelated goals; do not invent recovery controls. Do not reapply historical preferences over later human choices. Never replace an unreviewed conversation or start a duplicate writer.`; } // Routine notices quote only selected goal lines; full context stops at Log.