Commit 6c2e16a
authored
* fix(core): plumb cloud_timeout_minutes and stop wiping manual dependencies (#959)
1. --cloud-timeout was silently ignored. create_batch accepted
cloud_timeout_minutes and dropped it: it was never stored on BatchRun, and
execute_batch only receives the batch, so the value could not reach
_execute_task_subprocess and its default of 30 always won —
`cf work batch run --engine cloud --cloud-timeout 60` did nothing.
Now a persisted BatchRun field with its own column (DDL + idempotent
migration, SCHEMA_VERSION 3 -> 4 so already-stamped workspaces actually
receive it), forwarded at all seven _execute_task_subprocess call sites
(serial, parallel, both supervisor retries, resume, and the two auto-strategy
paths). Persisting it is what makes resume restore the user's value instead
of falling back to 30.
2. apply_inferred_dependencies wiped hand-curated dependencies. Its docstring
promised it preserved them, but it passed the inferred list straight to
update_depends_on, which replaces depends_on wholesale — so under
--strategy auto a manual edge was silently replaced and the loss persisted
for every future run.
It now merges: existing edges keep their order and come first, inferred ones
are appended, duplicates collapse. An inferred edge that would close a cycle
is dropped with a warning — merging can create one that neither set had
alone (manual A->B plus inferred B->A), and the manual edge is explicit user
intent so the inferred one loses. The cycle check runs against a working
copy of the whole graph, so it also catches cycles formed across several
edges applied in the same call.
Note: tests/core/test_dependency_analyzer.py::test_only_updates_tasks_with_
dependencies asserted the OLD behaviour — it deliberately built a cycle and
expected it persisted. Its own comment called the cycle incidental ("we're just
testing apply logic"), and create_execution_plan refuses to schedule a cyclic
graph, so the assertion was pinning a bug. Updated with the reasoning inline
rather than deleted.
Closes #959
* fix(core): blame the edge being added, not any cycle in the graph (#959)
Caught by PR review. The guard ran detect_cycle over the whole workspace graph
after tentatively adding an edge — but update_depends_on performs no cycle
validation, so a workspace can already hold one. With a pre-existing A<->B
cycle, every later inferred edge (C->D, entirely unrelated) came back "cyclic",
was dropped, and the warning named A->B->A as the cause.
Replaced with a targeted reachability check: adding target -> start closes a
cycle exactly when target is already reachable from start. That is immune to
unrelated pre-existing cycles, reports the actual offending path, and is
cheaper than a full detector per candidate edge. The visited set means a
pre-existing cycle elsewhere terminates the walk rather than hanging it.
Verified the new test fails against the whole-graph version before keeping it.
1 parent 597b078 commit 6c2e16a
5 files changed
Lines changed: 419 additions & 19 deletions
File tree
- codeframe/core
- tests/core
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
577 | 577 | | |
578 | 578 | | |
579 | 579 | | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
580 | 583 | | |
581 | 584 | | |
582 | 585 | | |
| |||
597 | 600 | | |
598 | 601 | | |
599 | 602 | | |
| 603 | + | |
600 | 604 | | |
601 | 605 | | |
602 | 606 | | |
| |||
677 | 681 | | |
678 | 682 | | |
679 | 683 | | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
680 | 687 | | |
681 | 688 | | |
682 | 689 | | |
| |||
896 | 903 | | |
897 | 904 | | |
898 | 905 | | |
899 | | - | |
| 906 | + | |
900 | 907 | | |
901 | 908 | | |
902 | 909 | | |
| |||
937 | 944 | | |
938 | 945 | | |
939 | 946 | | |
940 | | - | |
| 947 | + | |
941 | 948 | | |
942 | 949 | | |
943 | 950 | | |
| |||
951 | 958 | | |
952 | 959 | | |
953 | 960 | | |
954 | | - | |
| 961 | + | |
955 | 962 | | |
956 | 963 | | |
957 | 964 | | |
| |||
1029 | 1036 | | |
1030 | 1037 | | |
1031 | 1038 | | |
1032 | | - | |
| 1039 | + | |
1033 | 1040 | | |
1034 | 1041 | | |
1035 | 1042 | | |
| |||
1357 | 1364 | | |
1358 | 1365 | | |
1359 | 1366 | | |
| 1367 | + | |
1360 | 1368 | | |
1361 | 1369 | | |
1362 | 1370 | | |
| |||
1555 | 1563 | | |
1556 | 1564 | | |
1557 | 1565 | | |
| 1566 | + | |
1558 | 1567 | | |
1559 | 1568 | | |
1560 | 1569 | | |
| |||
1801 | 1810 | | |
1802 | 1811 | | |
1803 | 1812 | | |
| 1813 | + | |
1804 | 1814 | | |
1805 | 1815 | | |
1806 | 1816 | | |
| |||
1814 | 1824 | | |
1815 | 1825 | | |
1816 | 1826 | | |
| 1827 | + | |
1817 | 1828 | | |
1818 | 1829 | | |
1819 | 1830 | | |
| |||
2341 | 2352 | | |
2342 | 2353 | | |
2343 | 2354 | | |
| 2355 | + | |
2344 | 2356 | | |
2345 | 2357 | | |
2346 | 2358 | | |
| |||
2356 | 2368 | | |
2357 | 2369 | | |
2358 | 2370 | | |
| 2371 | + | |
2359 | 2372 | | |
2360 | 2373 | | |
2361 | 2374 | | |
| |||
2471 | 2484 | | |
2472 | 2485 | | |
2473 | 2486 | | |
| 2487 | + | |
2474 | 2488 | | |
2475 | 2489 | | |
2476 | 2490 | | |
| |||
2705 | 2719 | | |
2706 | 2720 | | |
2707 | 2721 | | |
2708 | | - | |
2709 | | - | |
| 2722 | + | |
| 2723 | + | |
2710 | 2724 | | |
2711 | 2725 | | |
2712 | 2726 | | |
| |||
2727 | 2741 | | |
2728 | 2742 | | |
2729 | 2743 | | |
| 2744 | + | |
2730 | 2745 | | |
2731 | 2746 | | |
2732 | 2747 | | |
| |||
2774 | 2789 | | |
2775 | 2790 | | |
2776 | 2791 | | |
| 2792 | + | |
| 2793 | + | |
| 2794 | + | |
2777 | 2795 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
198 | 201 | | |
199 | 202 | | |
200 | 203 | | |
201 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
202 | 211 | | |
203 | | - | |
204 | | - | |
205 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
206 | 216 | | |
207 | 217 | | |
208 | 218 | | |
209 | 219 | | |
210 | 220 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
216 | 286 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
316 | 317 | | |
317 | 318 | | |
318 | 319 | | |
| 320 | + | |
319 | 321 | | |
320 | 322 | | |
321 | 323 | | |
| |||
580 | 582 | | |
581 | 583 | | |
582 | 584 | | |
| 585 | + | |
583 | 586 | | |
584 | 587 | | |
585 | 588 | | |
| |||
605 | 608 | | |
606 | 609 | | |
607 | 610 | | |
| 611 | + | |
| 612 | + | |
608 | 613 | | |
609 | 614 | | |
610 | 615 | | |
| |||
0 commit comments