Make planning goals concrete

This commit is contained in:
wassname
2026-08-26 12:05:04 +08:00
parent 0d972e81c3
commit fa7195eafb
6 changed files with 74 additions and 17 deletions
+1 -1
View File
@@ -427,7 +427,7 @@ function result(text: string, isError = false) {
function isPlanningReadOnlyCommand(command: string): boolean {
if (/[|>]/.test(command)) return false;
return command.split(/&&|;/).every((part) => /^(?:pwd|ls\b|git\s+(?:status|log|diff|show|branch)\b|rg\b|grep\b|find\b|head\b|tail\b|wc\b|stat\b|test\b)\b/.test(part.trim()));
return command.split(/&&|;/).every((part) => /^(?:cd\b|pwd|ls\b|git\s+(?:status|log|diff|show|branch)\b|rg\b|grep\b|find\b|head\b|tail\b|wc\b|stat\b|test\b)\b/.test(part.trim()));
}
/** Local time, not UTC: agents freehand-stamp their manual ## Log lines from the local clock they
+15 -11
View File
@@ -29,14 +29,17 @@
export const planDrafting = `\
You are in plan mode. You are making a short judgeable plan that captures the user's real goals, then tests it in conversation.
1. Explore the repository read-only first: resolve discoverable facts by looking them up, and only ask
the human when the answer is a genuine intent or preference choice. Do not write or run code in this
phase (edit/write are blocked except for the plan file; don't mutate state via bash either).
2. Resolve facts from the repository yourself. For high-impact human preferences, build a decision
tree and ask the whole independent frontier in one round. Give a recommended answer for each
question. Record each answer in ## Interview. Do not make the plan final while material user
decisions remain open.
3. When the objective is clear, draft the plan file and present it.
1. Explore the repository read-only first. Use read-only tools to resolve discoverable facts. Do not
write or run code in this phase (edit/write are blocked except for the plan file; don't mutate state
via bash either).
2. Before you draft a goal, identify its object and the observable result that will show it is done.
If either is uncertain, reduce uncertainty now: inspect the repository when it can answer, or ask the
human one focused question when only their intent or acceptance condition can answer. Do not present
the review menu with a placeholder goal such as "work out the thing", "improve it", or "investigate".
3. For high-impact human preferences, build a decision tree and ask the whole independent frontier
in one round. Give a recommended answer for each question. Record each answer in ## Interview. Do
not make the plan final while material user decisions remain open.
4. When every goal has an object and an observable result, draft the plan file and present it.
How this mode ends: after each settled draft the human gets a menu (Ready / Refine / Edit / Cancel).
Plan mode ends only when they pick Ready. Refine collects short revision notes. Edit opens the full
@@ -133,9 +136,10 @@ When the goals are drafted, present them and say the plan is final. Do not begin
export function planningState(planPath: string): string {
return `\
[PLANNING MODE]
The plan at ${planPath} is the only file you may change. Find facts yourself, then ask the human only
for unresolved preferences. Do not execute work, mark a goal [/] or [x], or sign off a goal. The plan
is not approved until the human selects Ready.`;
The plan at ${planPath} is the only file you may change. Use read-only tools to find facts yourself,
then ask the human one focused question for an unresolved intent or acceptance condition. Do not draft
a placeholder goal without a concrete object and observable result. Do not execute work, mark a goal
[/] or [x], or sign off a goal. The plan is not approved until the human selects Ready.`;
}
export function reminder(foldedPlan: string, planRel: string): string {