Merge branch 'claudedo/a76d9547ab4a41538b42de79a2c90299'

This commit is contained in:
mika kuns
2026-08-05 11:23:29 +02:00
2 changed files with 33 additions and 1 deletions
+5 -1
View File
@@ -259,11 +259,15 @@ public static class PromptFiles
Rules: do not change what the user asked for, and do not invent requirements. You are making the existing intent precise, not adding to it. If a task is too vague to sharpen without guessing, ASK instead of guessing. Report a short before/after per task.
If a task visibly bundles several independent features, or has a blocker that is not resolved by anything in its own description, do not force it into one description. Propose splitting it to the user; if they agree, create the pieces with add_task/add_subtask and only move the pieces the user confirmed into "surviving tasks" for the phases below. Split only what the task already asks for the "do not invent requirements" rule still applies.
## Phase 3 Run
Do NOT use run_task_now for a batch there is a single override slot and the second call fails with "override slot busy".
Read get_app_settings and tell the user how many parallel execution slots are configured (maxParallelExecutions). If it is 1, say plainly that the tasks will execute one after another and that the value is changeable in ClaudeDo's settings.
For each surviving task, resolve the effective max-turns it will run with task.MaxTurns, else the list's get_list_config MaxTurns, else the model's preset/global default and report it. If a task looks substantial (several files, or one you just split off above) but its effective turns look low, say so and ask before queuing it; set_task_config/get_task_config let you raise it per task.
Then, for each surviving task:
- Idle or Failed update_task_status(id, "Queued"). For a Failed task ask first whether to reset_failed_task and re-queue it, or skip it.
- Queued leave it; it is already waiting for a slot.
@@ -275,7 +279,7 @@ public static class PromptFiles
## Phase 4 Review and merge
Before merging anything, call preview_merge_set with every surviving task's id (the same targetBranch you are about to merge into). It tells you, per task, whether a clean merge-tree preview is even possible (status/conflictFiles/changedFileCount/behind) and which files more than one of the tasks changed (overlaps). Read the overlaps: a file two tasks both touch is where a same-branch collision could happen. This is a HINT, not proof it only catches same-file overlap, not a cross-file break (e.g. one task deletes a symbol another task's file still references), and a clean preview never guarantees the result compiles or passes tests. Use it to decide merge order and to know which pairs to look at extra carefully in step 1 below; it does not replace reading the diffs.
One task at a time, in the order the brief lists them (adjust the order if the overlap check suggests a safer sequence).
One task at a time. Default to the order the brief lists them. If the overlap check above (or the file lists you gathered in Phase 2) shows two or more tasks touching the same file, tell the user which tasks collide and merge those in an order you can justify (e.g. the one making the smaller change first) deviate from brief order only with that stated reason.
1. Inspect the change with get_task_diff (stat first, then the full diff if it is non-trivial) and sanity-check it against the task's title and description. If preview_merge_set flagged this task in an overlap, also skim the diff of the other task(s) sharing that file.
2. If the change looks wrong, incomplete, or risky, STOP and ask the user before merging offer reject_rerun (with feedback) or skip.
@@ -96,6 +96,34 @@ public class PromptFilesTests
Assert.Contains("Do not act on any single task before you have read", d);
}
[Fact]
public void DefaultFor_merge_helper_allows_splitting_bundled_tasks_in_phase_2()
{
var d = PromptFiles.DefaultFor(PromptKind.MergeHelper);
Assert.Contains("Propose splitting it to the user", d);
Assert.Contains("add_task/add_subtask", d);
Assert.Contains("do not invent requirements", d);
}
[Fact]
public void DefaultFor_merge_helper_checks_effective_max_turns_before_queuing()
{
var d = PromptFiles.DefaultFor(PromptKind.MergeHelper);
Assert.Contains("effective max-turns", d);
Assert.Contains("get_list_config", d);
Assert.Contains("set_task_config", d);
Assert.Contains("get_task_config", d);
}
[Fact]
public void DefaultFor_merge_helper_checks_file_collisions_before_merge_order()
{
var d = PromptFiles.DefaultFor(PromptKind.MergeHelper);
Assert.Contains("Default to the order the brief lists them", d);
Assert.Contains("tell the user which tasks collide", d);
Assert.Contains("NORMAL case, not a failure", d);
}
[Fact]
public void DefaultFor_merge_helper_initial_has_repo_token()
{