ci(cmux-next): a target the manifest declares passes graph coverage until the base autofix adds it
The target graph Packages/macOS/CmuxNext/ci-target-graph.json is bot-only (#21946). A pull request can't commit it, and the base autofix regenerates it after the merge. But GraphCoversThePackage.test_every_source_and_test_directory_is_a_target requires every target directory to already be in the graph. So every PR that adds a SwiftPM target fails cmux-next checks (Tier routing) with a red it can't fix. #21818 is one example: it adds CmuxNextAgentIntegrations and CmuxNextAgentIntegrationsTests.
What changes:
- A target directory that
Package.swiftdeclares but the graph doesn't list yet now passes. The docs already say a manifest change routes every tier, so such a PR isn't under-tested in the meantime. - A Swift directory that the manifest doesn't declare still fails, as before.
- New test
test_the_manifest_reader_finds_the_graph_targets: the manifest reader must find every graph target whose directory exists. This keeps the allowance from quietly letting directories through if the regex breaks.
Only tests/test_cmux_next_route.py changes. I didn't run it on cosmic-gray; CI's cmux-next checks runs it. I checked by hand that the regex finds 121 of the graph's 122 targets. The one it misses is the binary target CCmuxAppFFI, which has no path and is skipped.
No capture: CI test only, no UI.
Agent session: cosmic-gray
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes cmux-next Tier routing so PRs that add a SwiftPM target to Package.swift no longer fail the graph coverage check. ci-target-graph.json is bot-only (#21946): a PR can't commit it, and the base autofix regenerates it after merge, so every manifest-changing PR like #21818 went red with no way to fix it. A target the manifest declares now passes until the autofix adds it, while a directory the manifest doesn't declare still fails. The allowance maps Tests/<name> to test targets and Sources/<name> to others, so a test directory can't pass for a regular target or vice versa. A companion test verifies the manifest reader finds every graph target whose directory exists, keeping the allowance from quietly letting stray directories through.