Correct runtime recovery commands
This commit is contained in:
@@ -104,7 +104,11 @@ must remain untouched and eligible run cleanup must still complete.
|
||||
|
||||
**Priority:** P2
|
||||
|
||||
**Status:** Pending
|
||||
**Status:** Complete
|
||||
|
||||
Active input-recovery diagnostics now use the native `run SESSION --stage STAGE
|
||||
--force` route. Corresponding missing/corrupt-input tests were updated; retired
|
||||
command rejection tests remain intact. Verified stage and application tests.
|
||||
|
||||
**Stages:** 9, 12, 16, and the integration/documentation reconciliation in 21–23.
|
||||
|
||||
|
||||
@@ -384,10 +384,10 @@ func requiredBuiltInInputError(source string, execution analyzeExecutionContext)
|
||||
return fmt.Errorf("required built-in source %q is unavailable", source)
|
||||
}
|
||||
return fmt.Errorf(
|
||||
"required built-in source %q is unavailable; run narratio run-stage %s %s --force",
|
||||
"required built-in source %q is unavailable; run narratio run %s --stage %s --force",
|
||||
source,
|
||||
entry.ProducerStage,
|
||||
execution.SessionID,
|
||||
entry.ProducerStage,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -128,13 +128,13 @@ func resolveAnalyzeInputIdentity(
|
||||
return identity, "", nil, nil
|
||||
}
|
||||
return analyzeInputIdentity{}, "", nil, fmt.Errorf(
|
||||
"required prepared input source %q is unavailable; run narratio run-stage prepare %s --force",
|
||||
"required prepared input source %q is unavailable; run narratio run %s --stage prepare --force",
|
||||
descriptor.Source.ID,
|
||||
execution.SessionID,
|
||||
)
|
||||
}
|
||||
return analyzeInputIdentity{}, "", nil, fmt.Errorf(
|
||||
"prepared input source %q is invalid; run narratio run-stage prepare %s --force: %w",
|
||||
"prepared input source %q is invalid; run narratio run %s --stage prepare --force: %w",
|
||||
descriptor.Source.ID,
|
||||
execution.SessionID,
|
||||
preparedErr,
|
||||
@@ -184,13 +184,13 @@ func missingAnalyzeInputError(
|
||||
switch descriptor.Source.Kind {
|
||||
case artifactpolicy.SourceKindPreviousArtifact:
|
||||
return fmt.Errorf(
|
||||
"required previous-session input source %q is unavailable; run narratio run-stage prepare %s --force",
|
||||
"required previous-session input source %q is unavailable; run narratio run %s --stage prepare --force",
|
||||
source,
|
||||
execution.SessionID,
|
||||
)
|
||||
case artifactpolicy.SourceKindExtraction:
|
||||
return fmt.Errorf(
|
||||
"required extraction source %q is unavailable; enable and configure pipeline.notarius output %q, then run narratio run-stage extract %s --force",
|
||||
"required extraction source %q is unavailable; enable and configure pipeline.notarius output %q, then run narratio run %s --stage extract --force",
|
||||
source,
|
||||
descriptor.Source.ConfiguredKey,
|
||||
execution.SessionID,
|
||||
|
||||
@@ -160,7 +160,7 @@ func TestResolveAnalyzeInputIdentitiesRecordsOptionalAbsenceAndRejectsRequiredAb
|
||||
_, err = resolveAnalyzeInputIdentities(map[string]config.ScriptoriumInputConfig{
|
||||
"players": {Source: sourceID, Required: true},
|
||||
}, execution)
|
||||
if err == nil || !strings.Contains(err.Error(), "run narratio run-stage prepare") {
|
||||
if err == nil || !strings.Contains(err.Error(), "run narratio run 2026-05-03 --stage prepare") {
|
||||
t.Fatalf("required input error = %v, want prepare guidance", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -458,7 +458,7 @@ func TestAnalyzeFailsWhenRequiredCanonicalPreviousRecapMissing(t *testing.T) {
|
||||
if err == nil {
|
||||
t.Fatal("expected error, got nil")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "narratio run-stage prepare 2026-05-03 --force") {
|
||||
if !strings.Contains(err.Error(), "narratio run 2026-05-03 --stage prepare --force") {
|
||||
t.Fatalf("error = %q, want executable prepare guidance", err.Error())
|
||||
}
|
||||
}
|
||||
@@ -828,7 +828,7 @@ func TestAnalyzeRequiredPreviousSessionArtifactInputGuidesPrepareForce(t *testin
|
||||
if err == nil {
|
||||
t.Fatal("expected error, got nil")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "narratio run-stage prepare 2026-05-03 --force") {
|
||||
if !strings.Contains(err.Error(), "narratio run 2026-05-03 --stage prepare --force") {
|
||||
t.Fatalf("error = %q, want executable prepare guidance", err.Error())
|
||||
}
|
||||
}
|
||||
@@ -973,7 +973,7 @@ func TestAnalyzeFailsWhenTrimmedTranscriptMissing(t *testing.T) {
|
||||
if err == nil {
|
||||
t.Fatal("expected error, got nil")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "narratio.transcript.final_trimmed") || !strings.Contains(err.Error(), "narratio run-stage trim 2026-05-03 --force") {
|
||||
if !strings.Contains(err.Error(), "narratio.transcript.final_trimmed") || !strings.Contains(err.Error(), "narratio run 2026-05-03 --stage trim --force") {
|
||||
t.Fatalf("error = %q, want executable trimmed transcript guidance", err.Error())
|
||||
}
|
||||
}
|
||||
@@ -1042,7 +1042,7 @@ func TestAnalyzeMissingRequiredBuiltInInputsProvideExecutableGuidance(t *testing
|
||||
if err == nil {
|
||||
t.Fatal("Run() error = nil, want required input error")
|
||||
}
|
||||
command := "narratio run-stage " + tt.stage + " 2026-05-03 --force"
|
||||
command := "narratio run 2026-05-03 --stage " + tt.stage + " --force"
|
||||
if !strings.Contains(err.Error(), tt.source) || !strings.Contains(err.Error(), command) {
|
||||
t.Fatalf("Run() error = %q, want source %q and command %q", err, tt.source, command)
|
||||
}
|
||||
@@ -1225,7 +1225,7 @@ func TestAnalyzeMissingRequiredPreparedStableInputFailsWithPrepareGuidance(t *te
|
||||
t.Fatal("expected error, got nil")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "prepared input source \"narratio.input.players\" is unavailable") ||
|
||||
!strings.Contains(err.Error(), "run narratio run-stage prepare 2026-05-03 --force") {
|
||||
!strings.Contains(err.Error(), "run narratio run 2026-05-03 --stage prepare --force") {
|
||||
t.Fatalf("error = %q, want prepared input guidance", err.Error())
|
||||
}
|
||||
}
|
||||
@@ -1271,7 +1271,7 @@ func TestAnalyzeInvalidOptionalPreparedStableInputFailsWithPrepareGuidance(t *te
|
||||
|
||||
_, err := (analyzeStage{}).Run(context.Background(), env, m)
|
||||
if err == nil || !strings.Contains(err.Error(), "prepared input source \"narratio.input.players\" is invalid") ||
|
||||
!strings.Contains(err.Error(), "run narratio run-stage prepare 2026-05-03 --force") {
|
||||
!strings.Contains(err.Error(), "run narratio run 2026-05-03 --stage prepare --force") {
|
||||
t.Fatalf("Run() error = %v, want invalid prepared input guidance", err)
|
||||
}
|
||||
}
|
||||
@@ -1345,7 +1345,7 @@ func TestAnalyzeFailsWhenNormalizedTranscriptMissing(t *testing.T) {
|
||||
if err == nil {
|
||||
t.Fatal("expected error, got nil")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "narratio.transcript.final") || !strings.Contains(err.Error(), "narratio run-stage normalize 2026-05-03 --force") {
|
||||
if !strings.Contains(err.Error(), "narratio.transcript.final") || !strings.Contains(err.Error(), "narratio run 2026-05-03 --stage normalize --force") {
|
||||
t.Fatalf("error = %q, want executable normalized transcript guidance", err.Error())
|
||||
}
|
||||
if len(fake.RunRequests) != 0 {
|
||||
@@ -1366,7 +1366,7 @@ func TestAnalyzeFailsWhenRenderedMarkdownTranscriptMissing(t *testing.T) {
|
||||
if err == nil {
|
||||
t.Fatal("expected error, got nil")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "run narratio run-stage render") || !strings.Contains(err.Error(), "--force") {
|
||||
if !strings.Contains(err.Error(), "run narratio run 2026-05-03 --stage render") || !strings.Contains(err.Error(), "--force") {
|
||||
t.Fatalf("error = %q, want render guidance", err.Error())
|
||||
}
|
||||
}
|
||||
@@ -1384,7 +1384,7 @@ func TestAnalyzeFailsWhenRenderedTrimmedMarkdownTranscriptMissing(t *testing.T)
|
||||
if err == nil {
|
||||
t.Fatal("expected error, got nil")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "run narratio run-stage render") || !strings.Contains(err.Error(), "--force") {
|
||||
if !strings.Contains(err.Error(), "run narratio run 2026-05-03 --stage render") || !strings.Contains(err.Error(), "--force") {
|
||||
t.Fatalf("error = %q, want render guidance", err.Error())
|
||||
}
|
||||
}
|
||||
@@ -1601,7 +1601,7 @@ func TestAnalyzeRequiredUnavailableExtractionFailsWithGuidance(t *testing.T) {
|
||||
env.Config.ArtifactCatalog.Artifacts["session_recap"] = artifact
|
||||
|
||||
_, err := (analyzeStage{}).Run(context.Background(), env, m)
|
||||
if err == nil || !strings.Contains(err.Error(), "pipeline.notarius output \"encounters\"") || !strings.Contains(err.Error(), "narratio run-stage extract 2026-05-03 --force") {
|
||||
if err == nil || !strings.Contains(err.Error(), "pipeline.notarius output \"encounters\"") || !strings.Contains(err.Error(), "narratio run 2026-05-03 --stage extract --force") {
|
||||
t.Fatalf("Run() error = %v, want actionable extraction guidance", err)
|
||||
}
|
||||
if len(fake.RunRequests) != 0 {
|
||||
|
||||
@@ -275,7 +275,7 @@ func resolveExtractReferences(
|
||||
identity, err := artifacts.ResolvePreparedInput(paths, m, sourceID)
|
||||
if err != nil {
|
||||
return resolvedExtractReferences{}, fmt.Errorf(
|
||||
"reference %q source %q is unavailable or invalid; run narratio run-stage prepare %s --force: %w",
|
||||
"reference %q source %q is unavailable or invalid; run narratio run %s --stage prepare --force: %w",
|
||||
selector,
|
||||
sourceID,
|
||||
sessionID,
|
||||
|
||||
@@ -573,7 +573,7 @@ func TestExtractStageRejectsUnavailableReferenceBeforeInvocationOrRunDirectoryCr
|
||||
}
|
||||
|
||||
result, err := (extractStage{}).Run(context.Background(), env, m)
|
||||
if err == nil || !strings.Contains(err.Error(), "run narratio run-stage prepare ") || !strings.Contains(err.Error(), "--force") {
|
||||
if err == nil || !strings.Contains(err.Error(), "run narratio run "+m.SessionID+" --stage prepare ") || !strings.Contains(err.Error(), "--force") {
|
||||
t.Fatalf("Run() result = %#v error = %v", result, err)
|
||||
}
|
||||
if len(fake.Requests) != 0 {
|
||||
@@ -798,7 +798,7 @@ func TestExtractStageResumeValidationErrorsForUnavailablePreparedReference(t *te
|
||||
test.mutate(t, path, m)
|
||||
|
||||
validation, err := (extractStage{}).ValidateResume(context.Background(), env, m)
|
||||
if err == nil || !strings.Contains(err.Error(), "run narratio run-stage prepare ") || !strings.Contains(err.Error(), "--force") {
|
||||
if err == nil || !strings.Contains(err.Error(), "run narratio run "+m.SessionID+" --stage prepare ") || !strings.Contains(err.Error(), "--force") {
|
||||
t.Fatalf("ValidateResume() validation = %#v error = %v", validation, err)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -249,10 +249,10 @@ func wrapRenderInputResolveError(err error, sessionID, sourceID, guidanceStage s
|
||||
var notFound *artifacts.SessionArtifactNotFoundError
|
||||
if errors.As(err, ¬Found) {
|
||||
return fmt.Errorf(
|
||||
"render: required input %q is unavailable; run narratio run-stage %s %s --force",
|
||||
"render: required input %q is unavailable; run narratio run %s --stage %s --force",
|
||||
sourceID,
|
||||
guidanceStage,
|
||||
sessionID,
|
||||
guidanceStage,
|
||||
)
|
||||
}
|
||||
return fmt.Errorf("render: resolve %q input: %w", sourceID, err)
|
||||
|
||||
@@ -105,7 +105,7 @@ func TestRenderStageFailsWhenFinalInputMissing(t *testing.T) {
|
||||
if err == nil {
|
||||
t.Fatal("expected error, got nil")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "run narratio run-stage normalize") || !strings.Contains(err.Error(), "--force") {
|
||||
if !strings.Contains(err.Error(), "run narratio run 2026-05-03 --stage normalize") || !strings.Contains(err.Error(), "--force") {
|
||||
t.Fatalf("error = %q, want normalize guidance", err.Error())
|
||||
}
|
||||
}
|
||||
@@ -120,7 +120,7 @@ func TestRenderStageFailsWhenFinalTrimmedInputMissing(t *testing.T) {
|
||||
if err == nil {
|
||||
t.Fatal("expected error, got nil")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "run narratio run-stage trim") || !strings.Contains(err.Error(), "--force") {
|
||||
if !strings.Contains(err.Error(), "run narratio run 2026-05-03 --stage trim") || !strings.Contains(err.Error(), "--force") {
|
||||
t.Fatalf("error = %q, want trim guidance", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user