Class: RosettAi::Project::Manager

Inherits:
Object
  • Object
show all
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.

Author:

  • hugo

  • claude

Instance Method Summary collapse

Constructor Details

#initialize(project_root:) ⇒ Manager

Returns a new instance of Manager.

Parameters:

  • project_root (Pathname)

    root directory of the project



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

#infoHash

Returns project metadata and health status.

Returns:

  • (Hash)

    project info including name, engine, template, behaviours



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

#statusHash

Returns comprehensive project status.

Returns:

  • (Hash)

    status with :info, :drift, :health



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