refactor: Migrate prune lockfile keys to resolution identities (#13524)
## Intent
Continue the external-resolution migration: prune’s JS lockfile-key
union must use the same exact per-package resolution identities as
hashing/query, not legacy `PackageInfo::transitive_dependencies`.
## Changes
- `PackageGraph::external_package_identities_for_packages`
- Prune lockfile-key union consumes those identities for retained JS
workspaces
- Preserve external-peer lockfile expansion and JS/Cargo separation
## Out of scope
Lockfile subgraph redesign, Cargo prune plans, global hash, field
deletion.
## Testing
- `cargo test -p turborepo-repository --lib test_lockfile_traversal`
- `cargo test -p turborepo-lib --lib prune`
- `cargo clippy -p turborepo-repository -p turborepo-lib --all-targets
-- -D warnings`
Closes TURBO-5812.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Anthony Shew <anthonyshew@users.noreply.github.com>