Monorepo management for opam overlays

Fix verse remotes and push phases to skip failed clones

The verse remotes phase and remote push phase were using the full
`repos` list instead of `successfully_fetched_repos`, causing crashes
when trying to access checkout directories that don't exist due to
failed clones.

Now both phases only operate on repos that were successfully cloned
or fetched, preventing "No such file or directory" errors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

+10 -6
+10 -6
lib/monopam.ml
··· 1545 1545 unchanged_count, 1546 1546 total_commits_pulled, 1547 1547 merge_errors, 1548 - subtree_errors ) = 1548 + subtree_errors, 1549 + successfully_fetched_repos ) = 1549 1550 if skip_pull then begin 1550 1551 Log.app (fun m -> 1551 1552 m " Skipping pull from remotes (--skip-pull)"); 1552 - ([], List.length repos, 0, ref [], ref []) 1553 + ([], List.length repos, 0, ref [], ref [], repos) 1553 1554 end 1554 1555 else begin 1555 1556 (* Step 3: Fetch phase - clone/fetch from remotes (PARALLEL) *) ··· 1666 1667 unchanged, 1667 1668 commits_pulled, 1668 1669 merge_errs, 1669 - subtree_errs ) 1670 + subtree_errs, 1671 + successfully_fetched ) 1670 1672 end 1671 1673 in 1672 1674 1673 1675 (* Step 5.5: Verse remotes - update and fetch from verse members *) 1676 + (* Only operate on successfully fetched repos to avoid missing directory errors *) 1674 1677 (match Verse_config.load ~fs:(fs_t :> _ Eio.Path.t) () with 1675 1678 | Error _ -> () (* No verse config, skip verse remotes *) 1676 1679 | Ok verse_config -> 1677 - sync_verse_remotes ~proc ~fs:fs_t ~config ~verse_config repos; 1680 + sync_verse_remotes ~proc ~fs:fs_t ~config ~verse_config successfully_fetched_repos; 1678 1681 (* Fetch from verse remotes in parallel *) 1679 1682 Log.app (fun m -> m " Fetching from verse remotes..."); 1680 1683 Eio.Fiber.List.iter ~max_fibers:4 1681 1684 (fun pkg -> fetch_verse_remotes ~proc ~fs:fs_t ~config pkg) 1682 - repos); 1685 + successfully_fetched_repos); 1683 1686 1684 1687 (* Step 6: Finalize - write README.md, CLAUDE.md, and dune-project (SEQUENTIAL) *) 1685 1688 Log.app (fun m -> ··· 1689 1692 write_dune_project ~proc ~fs:fs_t ~config all_pkgs; 1690 1693 1691 1694 (* Step 7: Remote phase - push to upstream remotes if --remote (LIMITED PARALLEL) *) 1695 + (* Only push repos that were successfully fetched *) 1692 1696 let remote_errors = 1693 1697 if remote then begin 1694 1698 Log.app (fun m -> m " Pushing to upstream remotes..."); ··· 1703 1707 | Ok () -> 1704 1708 Log.app (fun m -> m " Pushed %s" repo_name); 1705 1709 Ok repo_name) 1706 - repos 1710 + successfully_fetched_repos 1707 1711 in 1708 1712 let errors, successes = 1709 1713 List.partition_map