MCPcopy Create free account
hub / github.com/compozy/agh / normalizeForceFailRun

Function normalizeForceFailRun

internal/task/force_ops.go:558–576  ·  view source on GitHub ↗
(req ForceFailRun)

Source from the content-addressed store, hash-verified

556}
557
558func normalizeForceFailRun(req ForceFailRun) (ForceFailRun, error) {
559 req.Reason = strings.TrimSpace(req.Reason)
560 if req.Reason == "" {
561 return ForceFailRun{}, forceRunDiagnosticError(
562 diagnosticcontract.CodeForceOpRequiresReason,
563 "Force fail requires a reason",
564 "Provide --reason so the recovery audit event explains why the run was failed.",
565 diagnosticcontract.SeverityError,
566 "agh task fail <run-id> --reason \"operator recovery\"",
567 nil,
568 ErrForceOpRequiresReason,
569 )
570 }
571 req.Metadata = normalizeRawJSON(req.Metadata)
572 if err := ValidateMetadataSize(req.Metadata, "force_fail.metadata"); err != nil {
573 return ForceFailRun{}, err
574 }
575 return req, nil
576}
577
578func normalizeRetryRunRequest(req RetryRunRequest) (RetryRunRequest, error) {
579 req.Metadata = normalizeRawJSON(req.Metadata)

Callers 1

ForceFailRunMethod · 0.85

Calls 3

forceRunDiagnosticErrorFunction · 0.85
ValidateMetadataSizeFunction · 0.85
normalizeRawJSONFunction · 0.70

Tested by

no test coverage detected