Package org.egothor.methodatlas.command
Class CheckPromptsCommand
java.lang.Object
org.egothor.methodatlas.command.CheckPromptsCommand
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringFlag that selects this utility mode.static final StringFlag supplying a custom method-classification template file.static final StringFlag supplying a custom standalone credential-triage template file.static final StringFlag supplying a custom folded credential-triage appendix template file. -
Method Summary
Modifier and TypeMethodDescriptionintexecute(PrintWriter out) Validates each template kind and prints a report.static CheckPromptsCommandBuilds a command by scanning raw command-line arguments for the three prompt-override flags.
-
Field Details
-
FLAG_CHECK_PROMPTS
Flag that selects this utility mode.- See Also:
-
FLAG_CLASSIFICATION_PROMPT
Flag supplying a custom method-classification template file.- See Also:
-
FLAG_TRIAGE_PROMPT
Flag supplying a custom folded credential-triage appendix template file.- See Also:
-
FLAG_DEDICATED_TRIAGE_PROMPT
Flag supplying a custom standalone credential-triage template file.- See Also:
-
-
Method Details
-
fromArgs
Builds a command by scanning raw command-line arguments for the three prompt-override flags.- Parameters:
args- raw command-line arguments; must not benull- Returns:
- a configured command; never
null
-
execute
Validates each template kind and prints a report.- Specified by:
executein interfaceCommand- Parameters:
out- writer receiving the report; nevernull- Returns:
0when every template is valid;1otherwise- Throws:
IOException- never thrown directly; per-file read failures are reported inline as validation failures
-