Package org.egothor.methodatlas.command


package org.egothor.methodatlas.command
CLI command handler implementations for MethodAtlas.

Each class in this package encapsulates one logical CLI mode and implements the Command interface. The thin routing layer in MethodAtlasApp.run(java.lang.String[], java.io.PrintWriter) selects the appropriate command based on the parsed command-line flags and delegates to it via Command.execute(java.io.PrintWriter).

Command handlers

Shared infrastructure

The shared infrastructure that the commands compose is decomposed into a small set of focused collaborators:

  • PluginLoader — resolves TestDiscovery and SourcePatcher providers via ServiceLoader and validates plugin-ID uniqueness.
  • OverrideLoader — loads classification override YAML files into ClassificationOverride instances.
  • ContentHasher — produces SHA-256 class fingerprints and forward-slashed scan-root file prefixes; pure static helpers.
  • AiRuntimeBuilder — builds the per-run AI engine, the result cache, and resolves taxonomy metadata.
  • ScanOrchestrator — owns the scan-and-emit loop and the apply-tags helpers (collectMethodsByFile, gatherAiSuggestionsForFile, filterSink). Constructed once per CLI run with an injected PluginLoader.

Access conventions

All classes in this package are declared public so that the routing layer in MethodAtlasApp can instantiate them. They are nonetheless considered internal implementation details: callers outside this package should not depend on specific command classes; they should interact only with the Command interface.

  • Class
    Description
    Bundle of AI infrastructure that is constant for the duration of a scan run.
    Constructs the per-run AI infrastructure: the suggestion engine, the result cache, and the human-readable taxonomy descriptor.
    CLI command handler for the -apply-tags mode.
    CLI command handler for the -apply-tags-from-csv mode.
    Utility CLI mode (-check-prompts) that validates prompt templates and prints their SHA-256 checksums without running a scan.
    A self-contained CLI command handler.
    Applies the loaded CommentRedactors to source text on its way to an AI provider, failing closed.
    Pure utility helpers for content fingerprints and scan-root path prefixes.
    Selects files to scan for credentials by mask and reads each into a CredentialScanUnit.
    Runs the deterministic detectors over the scan units, attaches best-effort enclosing-method attribution, and produces CredentialFindings.
    A method's line span, used for attribution.
    CLI command handler for the -diff mode.
    Utility CLI mode (-eval-accuracy) that measures how accurate the AI classification is against a human-reviewed labelled set.
    CLI command handler for the -github-annotations output mode.
    CLI command handler for the -json output mode.
    CLI command handler for the -manual-prepare mode.
    Loads classification override files into ClassificationOverride instances.
    Resolves and configures discovery plugins via ServiceLoader.
    Thrown when -redact-comments is active and comment redaction cannot be guaranteed for a source file, so the run must abort before any source is sent to an AI provider (fail-closed).
    CLI command handler for the -sarif output mode.
    CLI command handler for the default CSV and -plain output modes.
    Orchestrates the scan-and-emit loop that every command mode is built around.