brent.edwards
01b6eb1804
feat(autonomy): parallel execution scales to 10+ concurrent subplans ( #1201 )
...
## Summary
Add M6 parallel-scaling coverage for 10+ concurrent subplans:
- **15-subplan parallel scenario** with explicit peak-concurrency bound checks (`max_parallel=10`) and thread-safe concurrency tracking via `_build_executor()`.
- **Deep hierarchical decomposition** coverage (4+ levels) with adjusted leaf condition that only stops early when hitting `max_depth` or when the workset is trivially small (`min_files_per_subplan`).
- **Non-progress guard** in `_build_hierarchy` to prevent pathological recursion when clustering cannot meaningfully split the file set.
- **Small-project regression test** (< 50 files) verifying decomposition depth does not increase unexpectedly with the relaxed leaf condition.
- **ASV benchmark** for 15-subplan parallel execution with `max_parallel=10` to track scaling behavior.
### Removed from this PR
The `_build_hierarchy` child-linkage correctness fix (returning `node_id` from recursive calls instead of using `nodes[-1].node_id`) has been **removed** per review feedback — it is a separate bug fix and will be submitted as an independent issue/PR per CONTRIBUTING.md §Atomic Commits.
## Approach
- **Concurrency tracking:** The `_build_executor()` closure in step definitions detects `context.concurrency_counter` / `context.concurrency_lock` and performs thread-safe peak tracking in a try/finally block.
- **Leaf condition:** Replaced the `max_files_per_subplan` / `max_tokens_per_subplan` leaf check with a `min_files_per_subplan` check to allow deeper decomposition for large projects. Added a non-progress guard so clustering that cannot split the file set terminates immediately rather than recursing to `max_depth`.
- **Deterministic IDs:** `_ids_for_count()` preserves legacy fixed IDs for the first 5 subplans and generates additional deterministic IDs for scale scenarios.
## Validation
### Passing
- `nox -s lint` — all checks passed
- `nox -s typecheck` — 0 errors, 0 warnings
- `nox -s unit_tests` — 12,988 scenarios passed, 0 failed
- `nox -s coverage_report` — 97% (passes `--fail-under=97`)
Closes #855
Reviewed-on: cleveragents/cleveragents-core#1201
Co-authored-by: Brent E. Edwards <brent.edwards@cleverthis.com >
Co-committed-by: Brent E. Edwards <brent.edwards@cleverthis.com >
2026-03-31 23:57:39 +00:00
..
2026-03-13 18:21:50 +00:00
2026-03-31 16:01:58 +00:00
2026-03-31 16:01:58 +00:00
2026-03-31 21:47:12 +00:00
2026-03-31 16:01:58 +00:00
2026-03-31 16:01:58 +00:00
2026-03-31 16:01:58 +00:00
2026-03-31 16:01:58 +00:00
2026-03-31 16:01:58 +00:00
2026-03-31 16:01:58 +00:00
2026-03-26 06:19:14 +00:00
2026-03-26 06:19:14 +00:00
2026-03-31 21:47:12 +00:00
2026-03-15 19:33:11 -04:00
2026-03-30 23:40:36 +01:00
2026-03-17 09:53:57 +00:00
2026-03-26 13:41:31 +00:00
2026-03-30 18:27:59 +00:00
2026-03-30 18:27:59 +00:00
2026-03-30 19:35:23 +00:00
2026-03-31 21:47:12 +00:00
2026-03-28 05:27:14 +00:00
2026-03-28 05:27:14 +00:00
2026-03-26 13:41:31 +00:00
2026-03-31 16:01:58 +00:00
2026-03-31 16:01:58 +00:00
2026-03-18 06:58:39 +00:00
2026-03-20 21:22:10 +00:00
2026-03-20 21:22:10 +00:00
2026-03-30 17:06:49 -04:00
2026-03-31 21:47:12 +00:00
2026-03-27 23:53:22 +00:00
2026-03-12 23:32:48 +00:00
2026-03-12 23:32:48 +00:00
2026-03-22 05:01:06 +00:00
2026-03-20 21:22:10 +00:00
2026-03-20 21:22:10 +00:00
2026-03-30 13:18:07 +01:00
2026-03-30 13:18:07 +01:00
2026-03-30 13:18:07 +01:00
2026-03-30 13:18:07 +01:00
2026-03-30 13:18:07 +01:00
2026-03-21 05:30:01 +00:00
2026-03-18 16:51:14 +00:00
2026-03-20 21:22:10 +00:00
2026-03-31 21:47:12 +00:00
2026-03-21 00:29:49 +00:00
2026-03-20 21:22:10 +00:00
2026-03-21 01:14:18 +00:00
2026-03-31 11:03:20 +00:00
2026-03-23 22:22:16 +00:00
2026-03-18 06:58:39 +00:00
2026-03-26 07:50:09 +00:00
2026-03-26 07:50:09 +00:00
2026-03-31 21:47:12 +00:00
2026-03-22 01:54:33 +00:00
2026-03-19 23:30:55 +00:00
2026-03-22 05:01:06 +00:00
2026-03-31 21:47:12 +00:00
2026-03-20 21:22:10 +00:00
2026-03-17 13:14:37 -04:00
2026-03-31 21:47:12 +00:00
2026-03-22 05:01:06 +00:00
2026-03-31 21:47:12 +00:00
2026-03-30 21:48:01 +00:00
2026-03-30 21:48:01 +00:00
2026-03-20 21:22:10 +00:00
2026-03-20 21:22:10 +00:00
2026-03-27 12:57:03 +00:00
2026-03-24 08:46:58 +00:00
2026-03-20 21:22:10 +00:00
2026-03-17 09:53:57 +00:00
2026-03-25 17:49:06 +00:00
2026-03-21 01:40:58 +00:00
2026-03-29 16:23:04 +01:00
2026-03-30 17:06:49 -04:00
2026-03-20 21:22:10 +00:00
2026-03-31 21:47:12 +00:00
2026-03-23 18:41:53 +00:00
2026-03-20 21:22:10 +00:00
2026-03-17 09:53:57 +00:00
2026-03-31 11:03:20 +00:00
2026-03-31 21:47:12 +00:00
2026-03-26 07:52:09 +00:00
2026-03-16 22:50:27 +00:00
2026-03-20 21:22:10 +00:00
2026-03-30 23:40:36 +01:00
2026-03-30 23:40:36 +01:00
2026-03-30 23:40:36 +01:00
2026-03-30 23:40:36 +01:00
2026-03-20 21:22:10 +00:00
2026-03-18 17:16:32 +00:00
2026-03-31 21:47:12 +00:00
2026-03-20 21:22:10 +00:00
2026-03-19 07:53:43 +00:00
2026-03-19 07:53:43 +00:00
2026-03-20 21:22:10 +00:00
2026-03-31 21:47:12 +00:00
2026-03-20 21:22:10 +00:00
2026-03-20 21:22:10 +00:00
2026-03-27 23:53:22 +00:00
2026-03-17 09:53:57 +00:00
2026-03-21 01:40:58 +00:00
2026-03-26 11:52:52 +00:00
2026-03-31 16:01:58 +00:00
2026-03-31 11:31:00 +00:00
2026-03-31 21:47:12 +00:00
2026-03-31 16:01:58 +00:00
2026-03-31 21:47:12 +00:00
2026-03-30 13:19:08 +00:00
2026-03-24 22:01:48 +00:00
2026-03-31 21:47:12 +00:00
2026-03-24 22:01:48 +00:00
2026-03-31 21:47:12 +00:00
2026-03-31 21:47:12 +00:00
2026-03-29 18:57:15 +01:00
2026-03-27 23:53:22 +00:00
2026-03-30 09:21:51 +00:00
2026-03-27 11:10:56 +00:00
2026-03-27 11:10:56 +00:00
2026-03-31 21:47:12 +00:00
2026-03-30 11:51:27 +00:00
2026-03-31 21:47:12 +00:00
2026-03-24 13:01:12 +00:00
2026-03-31 21:47:12 +00:00
2026-03-24 13:01:12 +00:00
2026-03-31 21:47:12 +00:00
2026-03-31 21:47:12 +00:00
2026-03-31 21:47:12 +00:00
2026-03-26 07:50:09 +00:00
2026-03-18 10:09:06 +00:00
2026-03-30 08:42:48 +00:00
2026-03-30 13:18:07 +01:00
2026-03-30 17:48:48 +00:00
2026-03-31 21:47:12 +00:00
2026-03-31 21:47:12 +00:00
2026-03-18 17:16:32 +00:00
2026-03-30 23:40:36 +01:00
2026-03-30 19:52:51 +00:00
2026-03-31 21:47:12 +00:00
2026-03-29 18:57:15 +01:00
2026-03-15 19:59:38 -04:00
2026-03-17 09:53:57 +00:00
2026-03-26 07:50:09 +00:00
2026-03-20 21:22:10 +00:00
2026-03-26 17:35:34 +00:00
2026-03-30 17:06:49 -04:00
2026-03-31 21:47:12 +00:00
2026-03-26 07:50:09 +00:00
2026-03-31 01:49:16 +00:00
2026-03-30 17:06:49 -04:00
2026-03-30 17:06:49 -04:00
2026-03-17 09:53:57 +00:00
2026-03-20 21:22:10 +00:00
2026-03-30 17:06:49 -04:00
2026-03-17 09:53:57 +00:00
2026-03-20 21:22:10 +00:00
2026-03-26 07:50:09 +00:00
2026-03-26 07:50:09 +00:00
2026-03-30 23:40:36 +01:00
2026-03-23 23:33:33 +00:00
2026-03-20 21:22:10 +00:00
2026-03-30 13:18:07 +01:00
2026-03-31 21:47:12 +00:00
2026-03-30 13:18:07 +01:00
2026-03-23 23:33:33 +00:00
2026-03-30 23:40:36 +01:00
2026-03-18 06:58:39 +00:00
2026-03-20 21:22:10 +00:00
2026-03-18 08:13:56 +00:00
2026-03-30 23:40:36 +01:00
2026-03-20 21:22:10 +00:00
2026-03-20 21:22:10 +00:00
2026-03-17 09:53:57 +00:00
2026-03-17 09:53:57 +00:00
2026-03-22 05:01:06 +00:00
2026-03-19 06:53:06 +00:00
2026-03-17 09:53:57 +00:00
2026-03-31 21:47:12 +00:00
2026-03-30 17:12:20 +00:00
2026-03-30 08:42:48 +00:00
2026-03-30 14:33:28 +00:00
2026-03-30 14:33:28 +00:00
2026-03-13 13:32:52 +08:00
2026-03-20 21:22:10 +00:00
2026-03-31 21:47:12 +00:00
2026-03-19 09:30:35 +00:00
2026-03-20 21:22:10 +00:00
2026-03-20 21:22:10 +00:00
2026-03-18 10:09:06 +00:00
2026-03-18 10:09:06 +00:00
2026-03-31 21:47:12 +00:00
2026-03-30 10:18:19 +00:00
2026-03-20 22:28:32 +00:00
2026-03-20 21:22:10 +00:00
2026-03-20 21:22:10 +00:00
2026-03-30 10:18:19 +00:00
2026-03-20 21:22:10 +00:00
2026-03-25 13:05:04 +00:00
2026-03-30 23:40:36 +01:00
2026-03-30 23:40:36 +01:00
2026-03-30 23:40:36 +01:00
2026-03-30 13:18:07 +01:00
2026-03-31 21:47:12 +00:00
2026-03-30 19:17:41 +08:00
2026-03-17 09:53:57 +00:00
2026-03-20 21:22:10 +00:00
2026-03-31 21:47:12 +00:00
2026-03-24 13:53:41 +00:00
2026-03-27 10:50:15 +00:00
2026-03-31 21:47:12 +00:00
2026-03-18 02:30:00 +00:00
2026-03-30 13:44:54 +00:00
2026-03-19 14:03:17 +00:00
2026-03-18 02:30:00 +00:00
2026-03-24 13:21:12 +00:00
2026-03-20 21:22:10 +00:00
2026-03-18 02:30:00 +00:00
2026-03-31 21:47:12 +00:00
2026-03-18 01:45:25 +00:00
2026-03-20 21:22:10 +00:00
2026-03-20 21:22:10 +00:00
2026-03-28 00:57:51 +00:00
2026-03-29 18:57:15 +01:00
2026-03-21 03:14:40 +00:00
2026-03-29 18:57:15 +01:00
2026-03-31 21:47:12 +00:00
2026-03-29 18:57:15 +01:00
2026-03-20 21:22:10 +00:00
2026-03-21 04:46:45 +00:00
2026-03-30 13:18:07 +01:00
2026-03-27 23:53:22 +00:00
2026-03-20 21:22:10 +00:00
2026-03-31 21:47:12 +00:00
2026-03-20 21:22:10 +00:00
2026-03-20 21:22:10 +00:00
2026-03-20 21:22:10 +00:00
2026-03-24 08:46:58 +00:00
2026-03-19 09:30:35 +00:00
2026-03-20 21:22:10 +00:00
2026-03-20 21:22:10 +00:00
2026-03-20 21:22:10 +00:00
2026-03-31 23:57:39 +00:00
2026-03-18 17:07:07 +00:00
2026-03-28 05:27:14 +00:00
2026-03-28 05:27:14 +00:00
2026-03-27 22:01:03 +00:00
2026-03-27 05:58:35 +00:00
2026-03-27 05:58:35 +00:00
2026-03-27 05:58:35 +00:00
2026-03-28 00:30:26 +00:00
2026-03-27 05:58:35 +00:00
2026-03-26 01:02:10 +00:00
2026-03-27 22:53:33 +00:00
2026-03-27 05:58:35 +00:00
2026-03-27 05:58:35 +00:00
2026-03-27 05:58:35 +00:00
2026-03-28 04:15:49 +00:00
2026-03-27 05:58:35 +00:00
2026-03-30 17:06:49 -04:00
2026-03-27 05:58:35 +00:00
2026-03-27 05:58:35 +00:00
2026-03-27 05:58:35 +00:00
2026-03-27 05:58:35 +00:00
2026-03-28 04:34:47 +00:00
2026-03-27 05:58:35 +00:00
2026-03-27 05:58:35 +00:00
2026-03-22 01:54:33 +00:00
2026-03-27 05:58:35 +00:00
2026-03-27 05:58:35 +00:00
2026-03-27 05:58:35 +00:00
2026-03-27 05:58:35 +00:00
2026-03-27 05:58:35 +00:00
2026-03-28 18:09:27 +00:00
2026-03-20 23:51:46 +00:00
2026-03-31 11:31:00 +00:00
2026-03-29 18:57:15 +01:00
2026-03-20 21:22:10 +00:00
2026-03-20 21:22:10 +00:00
2026-03-18 10:09:06 +00:00
2026-03-20 21:22:10 +00:00
2026-03-20 21:22:10 +00:00
2026-03-20 21:22:10 +00:00
2026-03-18 10:09:06 +00:00
2026-03-20 21:22:10 +00:00
2026-03-20 21:22:10 +00:00
2026-03-20 21:22:10 +00:00
2026-03-13 18:21:50 +00:00
2026-03-13 18:21:50 +00:00
2026-03-13 18:21:50 +00:00
2026-03-13 18:21:50 +00:00
2026-03-16 12:11:08 +00:00
2026-03-16 12:11:08 +00:00
2026-03-31 21:47:12 +00:00
2026-03-30 13:18:07 +01:00
2026-03-30 11:47:37 +08:00