Class: Insika::Doctor
- Inherits:
-
Object
- Object
- Insika::Doctor
- Defined in:
- lib/insika/doctor.rb
Overview
insika doctor (— OpenClaw's "strict config + doctor --fix",
"the repo's best productization discipline"). A read-only diagnosis of a
deployment's configuration that turns the scattered, silent boot warnings into
ONE structured report — and, with --fix, applies the safe autofixes.
Every check is DATA (config over convention): an id, a title, and a lambda that
inspects the injected collaborators and returns Findings. A Finding may carry a
fix proc; fix! runs those and re-diagnoses. Collaborators are optional so the
CLI can build them straight off the durable backend (no full app boot / no
DEEPSEEK) and an env-only caller can skip the store checks entirely.
Defined Under Namespace
Instance Method Summary collapse
-
#fix! ⇒ Object
Applies every fixable finding, then re-diagnoses.
-
#initialize(env: ENV, settings_store: nil, llm_provider_store: nil, tool_store: nil, agent_file_store: nil, skill_store: nil, skill_catalog: nil, profile_source: nil, backend: nil, extra_env_specs: []) ⇒ Doctor
constructor
A new instance of Doctor.
-
#run ⇒ Object
-> Report.
Constructor Details
#initialize(env: ENV, settings_store: nil, llm_provider_store: nil, tool_store: nil, agent_file_store: nil, skill_store: nil, skill_catalog: nil, profile_source: nil, backend: nil, extra_env_specs: []) ⇒ Doctor
Returns a new instance of Doctor.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/insika/doctor.rb', line 60 def initialize(env: ENV, settings_store: nil, llm_provider_store: nil, tool_store: nil, agent_file_store: nil, skill_store: nil, skill_catalog: nil, profile_source: nil, backend: nil, extra_env_specs: []) @env = env @settings_store = settings_store @llm_provider_store = llm_provider_store @tool_store = tool_store @agent_file_store = agent_file_store @skill_store = skill_store @skill_catalog = skill_catalog @profile_source = profile_source @backend = backend @extra_env_specs = extra_env_specs end |
Instance Method Details
#fix! ⇒ Object
Applies every fixable finding, then re-diagnoses. -> [Report before, Report after].
81 82 83 84 85 |
# File 'lib/insika/doctor.rb', line 81 def fix! before = run before.fixable.map(&:fix).each(&:call) [before, run] end |