Class: RosettAi::Project::Manager
- Inherits:
-
Object
- Object
- RosettAi::Project::Manager
- Defined in:
- lib/rosett_ai/project/manager.rb
Overview
High-level project lifecycle manager.
Orchestrates template application, drift detection, upstream sync, and project health reporting. Delegates to specialised classes.
Instance Method Summary collapse
-
#info ⇒ Hash
Returns project metadata and health status.
-
#initialize(project_root:) ⇒ Manager
constructor
A new instance of Manager.
-
#status ⇒ Hash
Returns comprehensive project status.
Constructor Details
#initialize(project_root:) ⇒ Manager
Returns a new instance of Manager.
22 23 24 25 |
# File 'lib/rosett_ai/project/manager.rb', line 22 def initialize(project_root:) @project_root = project_root @project_dir = project_root.join('.rosett-ai') end |
Instance Method Details
#info ⇒ Hash
Returns project metadata and health status.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/rosett_ai/project/manager.rb', line 30 def info validate_project! config = load_project_config origin = load_template_origin { project_name: config['project_name'] || File.basename(@project_root), default_engine: config['default_engine'] || 'generic', template: origin&.fetch('template', nil), template_applied_at: origin&.fetch('applied_at', nil), behaviours: count_behaviours, designs: count_designs, project_root: @project_root.to_s, project_dir: @project_dir.to_s } end |
#status ⇒ Hash
Returns comprehensive project status.
51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/rosett_ai/project/manager.rb', line 51 def status project_info = info drift = DriftDetector.new(project_root: @project_root) drift_results = drift.detect { info: project_info, drift: drift_results, health: compute_health(project_info, drift_results) } end |