Files
Martin Vogel 6d508350c7 fix(cross-repo): fail explicitly when zero target projects resolve (#1133)
A cross-repo-intelligence run whose targets resolved to nothing but the
source project -- a self-only target list, or ["*"] in a store that holds
only the source -- returned status "success" with projects_scanned:0.
That output is indistinguishable from "these services share no routes",
which is exactly the silent-zero result #1133 reports. Worse, the run had
already passed the pre-write validation and went on to delete the source's
existing CROSS_* edges, with no target to rebuild them from.

Root cause: cbm_cross_repo_match_cancellable validated that every resolved
target exists but never checked that at least one resolved target differs
from the source; the self entry was only skipped later, inside the match
loop, after delete_cross_edges had run.

Count the non-self targets during validation and fail before any write
when there are none, with a new result flag (no_targets) so the MCP/CLI
frontend reports a specific error ("resolved zero target projects ...
existing cross-repo edges were left unchanged") and exits non-zero.

The other halves of #1133 are already resolved on main: the
--target-projects '["*"]' flag form has parsed as a JSON array since
1a342553 (guarded here by an index_repository-specific CLI test), and
cross-repo mode has run in-process ahead of the index supervisor since
0e00ef57, so a cross-repo request can no longer surface the contained
worker-crash envelope with a 0-byte log (worker-log survival: 87717b0a).

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-09-25 18:37:16 +02:00
..