anchor.diff:    final segments = buildStep.inputId.pathSegments;
     final productionDependency =
         segments.length > 1 && _productionDirectories.contains(segments.first);
  -  final resource = await buildStep.fetchResource(
  -    productionDependency
  -        ? _productionDependencyCheckResource
  -        : _developmentDependencyCheckResource,
  -  );
  +  final resource =
  +      productionDependency ? _productionDependency : _developmentDependency;
   
  -  final errorMessage = await resource.run(buildStep);
  -
  -  if (errorMessage == null) return;
  -
  -  throw BadPackageDependencyError(errorMessage);
  +  await resource.run(buildStep);
   }
   
  -final _productionDependencyCheckResource =
  -    _OncePerBuild.resource<bool, String?>(true, _validatePubspec);
  +final _productionDependency = _OncePerBuild(true, _validatePubspec);
   
  -final _developmentDependencyCheckResource =
  -    _OncePerBuild.resource<bool, String?>(false, _validatePubspec);
  +final _developmentDependency = _OncePerBuild(false, _validatePubspec);
   
  -Future<String?> _validatePubspec(bool production, BuildStep buildStep) async {
  +Future<void> _validatePubspec(bool production, BuildStep buildStep) async {
     final pubspecAssetId = AssetId(buildStep.inputId.package, 'pubspec.yaml');
   
     if (!await buildStep.canRead(pubspecAssetId)) {
  
positive.code:   return null;
  }
  
  class _OncePerBuild<S, T> {
    final S state;
    final FutureOr<T> Function(S, BuildStep) _callback;
    AsyncMemoizer<T>? _memo;
  
    static Resource<_OncePerBuild<State, T>> resource<State, T>(
      State state,
      FutureOr<T> Function(State, BuildStep) callback,
    ) =>
        Resource<_OncePerBuild<State, T>>(
          () => _OncePerBuild._(state, callback),
          dispose: (c) => c._dispose(),
        );
  
    _OncePerBuild._(this.state, this._callback);
  
    Future<T> run(BuildStep buildStep) =>
        (_memo ??= AsyncMemoizer()).runOnce(() => _callback(state, buildStep));
  
    void _dispose() {
      _memo = null;
    }
  }
  
  
negative.code: 
    final pubspec = await readPubspec(pubspecAssetId);
  
    final errorMessage = _checkAnnotationConstraint(
      pubspec,
      !production,
    );
  
    if (errorMessage == null) return;
  
    throw BadPackageDependencyError(errorMessage);
  }
  
  String? _checkAnnotationConstraint(
  