Class CheckPromptsCommand

java.lang.Object
org.egothor.methodatlas.command.CheckPromptsCommand
All Implemented Interfaces:
Command

public final class CheckPromptsCommand extends Object implements Command
Utility CLI mode (-check-prompts) that validates prompt templates and prints their SHA-256 checksums without running a scan.

For each PromptTemplateKind it reports whether the effective template (the operator's override, if supplied via the matching flag, otherwise the built-in default) is structurally valid, lists any problems, and prints the checksum that a reproducibility receipt would record. It exits with status 1 if any template is invalid, making it suitable as a CI pre-flight gate; otherwise 0.

Validation covers placeholder correctness and the survival of the JSON structural anchor the response parser needs; it cannot verify that a model will follow the instructions (see PromptTemplateValidator).

Since:
4.1.0
  • Field Details

    • FLAG_CHECK_PROMPTS

      public static final String FLAG_CHECK_PROMPTS
      Flag that selects this utility mode.
      See Also:
    • FLAG_CLASSIFICATION_PROMPT

      public static final String FLAG_CLASSIFICATION_PROMPT
      Flag supplying a custom method-classification template file.
      See Also:
    • FLAG_TRIAGE_PROMPT

      public static final String FLAG_TRIAGE_PROMPT
      Flag supplying a custom folded credential-triage appendix template file.
      See Also:
    • FLAG_DEDICATED_TRIAGE_PROMPT

      public static final String FLAG_DEDICATED_TRIAGE_PROMPT
      Flag supplying a custom standalone credential-triage template file.
      See Also:
  • Method Details

    • fromArgs

      public static CheckPromptsCommand fromArgs(String... args)
      Builds a command by scanning raw command-line arguments for the three prompt-override flags.
      Parameters:
      args - raw command-line arguments; must not be null
      Returns:
      a configured command; never null
    • execute

      public int execute(PrintWriter out) throws IOException
      Validates each template kind and prints a report.
      Specified by:
      execute in interface Command
      Parameters:
      out - writer receiving the report; never null
      Returns:
      0 when every template is valid; 1 otherwise
      Throws:
      IOException - never thrown directly; per-file read failures are reported inline as validation failures