Class: RailsAiBridge::Doctor::Checkers::RegistryChecker

Inherits:
BaseChecker
  • Object
show all
Defined in:
lib/rails_ai_bridge/doctor/checkers/registry_checker.rb

Overview

Verifies the registry manifest is present, valid, and resolvable.

Checks (in order):

  1. The configured registry_manifest_path exists.
  2. The manifest JSON parses successfully.
  3. RegistryManifest.validate! passes schema validation.
  4. Registry.build_resolver returns a non-nil resolver.
  5. The lockfile exists and matches (when lockfile_path is configured).

Each failure short-circuits with an actionable fix hint so the user can resolve the first problem before chasing downstream symptoms.

Instance Attribute Summary

Attributes inherited from BaseChecker

#app

Instance Method Summary collapse

Methods inherited from BaseChecker

#initialize

Constructor Details

This class inherits a constructor from RailsAiBridge::Doctor::Checkers::BaseChecker

Instance Method Details

#callDoctor::Check

Returns :pass, :warn, or :fail.

Returns:



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/rails_ai_bridge/doctor/checkers/registry_checker.rb', line 19

def call
  return missing_manifest_check unless manifest_path_exists?

  return invalid_json_check unless manifest_parses?

  return validation_failed_check unless manifest_validates?

  resolver = build_resolver
  return resolver_failed_check(resolver) unless resolver

  return lockfile_check if lockfile_configured? && !lockfile_exists?

  new_check(name: 'Registry', status: :pass, message: 'Registry manifest is valid and resolvable', fix: nil)
end