After all subtasks finish, check whether the overall goal was met. Reports any deliverables from the original request that appear to be missing.
(queue)
| 316 | |
| 317 | |
| 318 | def _completion_audit(queue): |
| 319 | """ |
| 320 | After all subtasks finish, check whether the overall goal was met. |
| 321 | Reports any deliverables from the original request that appear to be missing. |
| 322 | """ |
| 323 | original = getattr(queue, 'original_request', '') |
| 324 | if not original: |
| 325 | return |
| 326 | |
| 327 | # Extract filenames the user expected to exist |
| 328 | expected_files = _FILE_RE.findall(original) |
| 329 | missing = [f for f in expected_files if not (Path.cwd() / f).exists()] |
| 330 | failed_tasks = [t for t in queue.tasks if t.status == 'failed'] |
| 331 | |
| 332 | if missing: |
| 333 | warning(f"[Audit] Requested file(s) not found after all steps: {', '.join(missing)}") |
| 334 | if failed_tasks: |
| 335 | warning(f"[Audit] {len(failed_tasks)} task(s) failed: " + |
| 336 | ', '.join(t.description[:50] for t in failed_tasks)) |
| 337 | if not missing and not failed_tasks: |
| 338 | info("[Audit] All expected deliverables present.") |
| 339 | |
| 340 | |
| 341 | def run_queue(queue, yolo=False): |