isRunnerPackageRoot function
Only the runner owns its package build cache. Host applications keep their own Flutter build output; running a suite must not prune the host's cache.
Implementation
bool isRunnerPackageRoot(Directory project) {
final pubspec = File(p.join(project.path, 'pubspec.yaml'));
if (!pubspec.existsSync()) return false;
return RegExp(r'^name:\s*ensemble_test_runner\s*$', multiLine: true)
.hasMatch(pubspec.readAsStringSync());
}