Class: Rigor::CLI::PluginsCommand
- Defined in:
- lib/rigor/cli/plugins_command.rb
Overview
rigor plugins — reports the activation status of every plugin entry in .rigor.yml so users (and the
rigor-project-init SKILL, CI gates, rigor init) can verify their plugin configuration is actually doing what
they think.
The command is read-only and idempotent: it loads the project's .rigor.yml (same discovery as rigor check),
runs Plugin::Loader.load to attempt instantiation, then prints a table of:
- load status (
loaded/load-errorwith reason); - resolved manifest id, version, description;
signature_paths:(absolute paths + per-dir.rbscount);- every manifest-declared extension surface
(
open_receivers:/owns_receivers:/produces:/consumes:/block_as_methods:/heredoc_templates:/trait_registries:/type_node_resolvers:/hkt_registrations:/hkt_definitions:/protocol_contracts:/source_rbs_synthesizer:); - the ADR-37 narrow extension protocols read off the plugin
class —
node_rulenode types,dynamic_returnreceivers,narrowing_factsmethods.
--capabilities switches to a focused catalogue of just the narrow-protocol gate values + produced/consumed facts
(ADR-37 § "Machine-readable capability catalogue") — the AI-legibility surface that lets an agent enumerate what
every plugin does.
Output formats: text (default, human-readable table) and json (for tooling — SKILLs, CI gates, editor
integrations).
Exit codes:
0— every configured plugin loaded.1— at least one plugin failed to load AND--strictwas passed. Without--strictthe command always exits 0; load errors are reported but not treated as a gate failure (matchingrigor triage's advisory shape).
Future expansion (not in this slice):
- Per-plugin diagnostic counts (would require running the full analysis pipeline; out of scope for an inspection command).
- Verification that
signature_pathsactually merged into the RBS environment without conflict (requires constructing the Environment, which is heavier than the loader-only pass this slice does).
Constant Summary collapse
- USAGE =
rubocop:disable Metrics/ClassLength
"Usage: rigor plugins [options]"
Instance Method Summary collapse
-
#run ⇒ Integer
CLI exit status.
Methods inherited from Command
Constructor Details
This class inherits a constructor from Rigor::CLI::Command
Instance Method Details
#run ⇒ Integer
Returns CLI exit status.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/rigor/cli/plugins_command.rb', line 64 def run = config_path = .fetch(:config) || Configuration.discover configuration = Configuration.load(.fetch(:config)) rows = build_rows(configuration) renderer = PluginsRenderer.new(rows: rows, configuration_path: config_path) @out.puts(render(renderer, )) any_load_errors = rows.any? { |row| row.fetch(:status) == :load_error } return 1 if any_load_errors && .fetch(:strict) 0 end |