Class EvidencePackCommand
The command is selected from MethodAtlasApp when the user passes
-evidence-pack <framework>. It owns its output directory: it
creates the directory if absent, refuses to overwrite an existing one
unless -evidence-pack-overwrite was supplied, writes all
artefacts, computes a SHA-256 manifest, and optionally signs that manifest
via ZeroEcho.
MethodAtlasApp is the only caller; the type is public so the
root package can construct it and read its outputDir() and
framework() for the post-run summary.
- Since:
- 4.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionEvidencePackCommand(CliConfig cliConfig, EvidencePackOptions packOptions, org.egothor.methodatlas.api.TestDiscoveryConfig discoveryConfig, org.egothor.methodatlas.ai.AiSuggestionEngine aiEngine, org.egothor.methodatlas.emit.ClassificationOverride override, AiResultCache aiCache, ScanOrchestrator orchestrator) Creates a new evidence-pack command. -
Method Summary
Modifier and TypeMethodDescriptionintexecute()Executes the command: runs the scan, writes every pack artefact, and — when a keyring is configured — signs the manifest.Returns the resolved framework name (canonical token).Returns the absolute path of the produced pack directory.
-
Constructor Details
-
EvidencePackCommand
public EvidencePackCommand(CliConfig cliConfig, EvidencePackOptions packOptions, org.egothor.methodatlas.api.TestDiscoveryConfig discoveryConfig, org.egothor.methodatlas.ai.AiSuggestionEngine aiEngine, org.egothor.methodatlas.emit.ClassificationOverride override, AiResultCache aiCache, ScanOrchestrator orchestrator) Creates a new evidence-pack command.- Parameters:
cliConfig- parsed CLI configurationpackOptions- evidence-pack–specific optionsdiscoveryConfig- discovery configuration forwarded to providersaiEngine- AI engine, ornullwhen AI is disabledoverride- classification overrideaiCache- AI result cacheorchestrator- pre-built scan orchestrator
-
-
Method Details
-
execute
Executes the command: runs the scan, writes every pack artefact, and — when a keyring is configured — signs the manifest.Ordering matters for the integrity chain. Artefacts are written first, then
pack-meta.json(optimistically recording whether signing was requested), thenmanifest.sha256(the SHA-256 of every artefact, includingpack-meta.json), and finally the manifest is signed. If signing fails,pack-meta.jsonis rewritten as unsigned, any partialmanifest.sha256.signedis deleted, andmanifest.sha256is re-hashed so itspack-meta.jsondigest still matches the file on disk. A signing failure is non-fatal — the pack is produced unsigned.- Returns:
0on success,1when one or more source files produced a parse or processing error- Throws:
IOException- if any pack artefact cannot be written
-
outputDir
Returns the absolute path of the produced pack directory. Useful for the caller's success message.- Returns:
- resolved absolute output directory
-
framework
Returns the resolved framework name (canonical token).- Returns:
- canonical framework token
-