feat(data): add dependency audit and diff-review threshold to list-handler prompts

Triage phase now audits dependsOnTaskId chains before handoff: distinguishes real
from artificial (plan-numbered) dependencies, resolves artificial ones via
update_task, groups survivors into a wave plan, and checks the wave count against
the 4-handoff cap (2 merge rounds) so a chain too long to finish says so explicitly
instead of stranding mid-run.

Merge phase now reads a task's own diff when preview_merge_set's changedFileCount
is below 5, reserving the sonnet review subagent for larger diffs where the
context-protection cost is actually worth it.

Updates DefaultFor_merge_helper_merge_never_reads_diffs_itself, renamed to
DefaultFor_merge_helper_merge_gates_the_diff_subagent_on_a_file_count_threshold,
to match the new threshold behavior.
This commit is contained in:
Mika Kuns
2026-09-02 12:16:44 +02:00
parent 56bc1651a8
commit 9e80564665
2 changed files with 16 additions and 4 deletions
@@ -221,11 +221,14 @@ public class PromptFilesTests
}
[Fact]
public void DefaultFor_merge_helper_merge_never_reads_diffs_itself()
public void DefaultFor_merge_helper_merge_gates_the_diff_subagent_on_a_file_count_threshold()
{
// Below 5 changed files a subagent hop is pure context-protection overhead for a tiny
// diff; the threshold keeps the subagent mandatory once a diff is actually large.
var d = PromptFiles.DefaultFor(PromptKind.MergeHelperMerge);
Assert.Contains("Never read a task's diff yourself", d);
Assert.Contains("Below 5 changed files", d);
Assert.Contains("sonnet subagent", d);
Assert.Contains("changedFileCount", d);
}
[Fact]