Currently each build script in a build produces two invocations in the build plan--one to compile the build script, and one to run it. However, they both have "target_kind": ["custom-build"] so it's difficult to distinguish them when consuming a build plan.
In my cargo-build-plan-graph tool I wound up using a heuristic that I do not love. It would be better if they had unique target_kind keys or some other straightforward way to distinguish them.
Here's a sample build plan from sccache.