mirror of
https://github.com/azaion/loader.git
synced 2026-04-22 22:16:32 +00:00
b0a03d36d6
Made-with: Cursor
1.2 KiB
1.2 KiB
Batching Algorithm Reference
Topological Sort with Batch Grouping
The /implement skill uses a topological sort to determine execution order,
then groups tasks into batches for parallel execution.
Algorithm
- Build adjacency list from
_dependencies_table.md - Compute in-degree for each task node
- Initialize batch 0 with all nodes that have in-degree 0
- For each batch: a. Select up to 4 tasks from the ready set b. Check file ownership — if two tasks would write the same file, defer one to the next batch c. Launch selected tasks as parallel implementer subagents d. When all complete, remove them from the graph and decrement in-degrees of dependents e. Add newly zero-in-degree nodes to the next batch's ready set
- Repeat until the graph is empty
File Ownership Conflict Resolution
When two tasks in the same batch map to overlapping files:
- Prefer to run the lower-numbered task first (it's more foundational)
- Defer the higher-numbered task to the next batch
- If both have equal priority, ask the user
Complexity Budget
Each batch should not exceed 20 total complexity points. If it does, split the batch and let the user choose which tasks to include.