Ignore files that are only imports for unstable packages
For buf breaking, We should ignore files being deleted if allow_unstable_packages is try that are:
- Marked as imports
- Only imported by unstable packages
This actually is probably somewhat easy - we have a designation of whether a file is an import or not as part of our ImageFile construct, and we can use that to denote whether a FILE_NO_DELETE should be emitted. The check will need to be done at a Files level though - if a file is deleted and it was a source or imported by a stable package, it still should be marked as deleted.
You could make an argument either way: technically, its part of your build, and a stable package, so you could argue that it is modifying a stable package, but you could also argue that for the sources you care about, imports are only part of the packages that import them, and if an unstable package is importing something and you don't care about unstable packages, then you don't care about its imports either.
This argument might apply for all breaking change rules that are only imports of unstable packages.
See https://github.com/bufbuild/buf/issues/2129.