Clarify operator command help and preflight migration
This commit is contained in:
@@ -48,7 +48,8 @@ func checkCleanInput(input *cleanCommandInput) error {
|
||||
|
||||
func cleanCommand(deps commandDependencies) commandkit.Command {
|
||||
common := newConfigurationFlags(func(input **cleanCommandInput) *configurationSelection { return &(*input).Selection })
|
||||
return commandkit.NewCommand(commandkit.CommandSpec[*cleanCommandInput]{Name: "clean", Summary: "Remove selected local session data.", NewInput: func() *cleanCommandInput { return &cleanCommandInput{} },
|
||||
return commandkit.NewCommand(commandkit.CommandSpec[*cleanCommandInput]{Name: "clean", Summary: "Remove entire local sessions, including prepared inputs and products.",
|
||||
Description: "Deletes the selected local session workspace, including its manifest, prepared inputs, products, and run history. Remote data and subprocess caches remain. Use --dry-run to preview deletion. To remove only run history while retaining a reusable session, use narratio run SESSION --stage cleanup; this requires workspace.cleanup_after_publish=true and valid successful publication evidence.", NewInput: func() *cleanCommandInput { return &cleanCommandInput{} },
|
||||
Flags: []commandkit.Flag[*cleanCommandInput]{common.Config, common.Overlay, common.Campaign, common.CampaignFile, common.SessionFile, common.PartyFile,
|
||||
commandkit.ValueFlag(commandkit.FlagMeta{Name: "previous-session-id", Usage: "Assert the previous session identity."}, nil, stringValue, func(input **cleanCommandInput, value commandkit.Supplied[string]) { (*input).PreviousSession = value }),
|
||||
commandkit.BoolFlag(commandkit.FlagMeta{Name: "all", Usage: "Clean all local session workspace entries."}, false, func(input **cleanCommandInput, value commandkit.Supplied[bool]) { (*input).All = value.Value }),
|
||||
|
||||
@@ -80,9 +80,15 @@ func executionCommand(name, summary string, regenerate bool, deps commandDepende
|
||||
|
||||
func executionCommandSpec(name, summary string, regenerate bool) commandkit.CommandSpec[*executionInput] {
|
||||
common := newConfigurationFlags(func(input **executionInput) *configurationSelection { return &(*input).Selection })
|
||||
artifactUsage := "Artifact or family targets for analysis and publication (repeatable or comma-separated)."
|
||||
description := ""
|
||||
if regenerate {
|
||||
artifactUsage = "Analysis artifact or family targets; extraction is not narrowed (repeatable or comma-separated)."
|
||||
description = "Forces the whole configured Notarius extraction, then rebuilds selected analysis targets and required prerequisites. --artifacts narrows analysis only. Stops before publication, notification, and cleanup."
|
||||
}
|
||||
flags := []commandkit.Flag[*executionInput]{common.Config, common.Overlay, common.Campaign, common.CampaignFile, common.SessionFile, common.PartyFile,
|
||||
commandkit.ValueFlag(commandkit.FlagMeta{Name: "previous-session-id", Usage: "Assert the previous session identity."}, nil, stringValue, func(input **executionInput, value commandkit.Supplied[string]) { (*input).PreviousSession = value }),
|
||||
commandkit.RepeatFlag(commandkit.FlagMeta{Name: "artifacts", Usage: "Analysis artifact or family targets (repeatable or comma-separated)."}, []string(nil), stringValue, func(input **executionInput, value commandkit.Supplied[[]string]) { (*input).Artifacts = value }),
|
||||
commandkit.RepeatFlag(commandkit.FlagMeta{Name: "artifacts", Usage: artifactUsage}, []string(nil), stringValue, func(input **executionInput, value commandkit.Supplied[[]string]) { (*input).Artifacts = value }),
|
||||
}
|
||||
if !regenerate {
|
||||
flags = append(flags,
|
||||
@@ -93,7 +99,7 @@ func executionCommandSpec(name, summary string, regenerate bool) commandkit.Comm
|
||||
)
|
||||
}
|
||||
return commandkit.CommandSpec[*executionInput]{
|
||||
Name: name, Summary: summary, NewInput: func() *executionInput { return &executionInput{} }, Flags: flags,
|
||||
Name: name, Summary: summary, Description: description, NewInput: func() *executionInput { return &executionInput{} }, Flags: flags,
|
||||
Arguments: []commandkit.Argument[*executionInput]{commandkit.ValueArgument(commandkit.ArgumentMeta{Name: "SESSION", Usage: "Session identity."}, true, stringValue, func(input **executionInput, value commandkit.Supplied[string]) { (*input).Selection.Session = value })},
|
||||
CheckInput: func(input *executionInput) error {
|
||||
if regenerate {
|
||||
|
||||
@@ -74,7 +74,14 @@ type sessionPublishedOutput struct {
|
||||
}
|
||||
|
||||
func sessionStateCommand(name string, status bool, deps commandDependencies) commandkit.Command {
|
||||
spec := sessionInspectionSpec(name, "Inspect session state without changing it.", !status)
|
||||
summary := "Inspect session artifact definitions and availability."
|
||||
description := "Reports definitions, dependencies, and local artifact evidence. Add --remote to inspect remote publication and locks. Does not read artifact payload bodies."
|
||||
if status {
|
||||
summary = "Inspect session progress and local and remote state."
|
||||
description = "Reports manifest stages, artifacts, configuration provenance, and readiness. Includes remote current state when storage is configured; remote inspection failures can return a partial report with a failed outcome."
|
||||
}
|
||||
spec := sessionInspectionSpec(name, summary, !status)
|
||||
spec.Description = description
|
||||
spec.Run = func(invocation commandkit.Invocation, input *sessionInspectionInput) commandkit.Outcome {
|
||||
report, err := inspectSelectedSessionState(invocation.Context, input, status, withCommandReporting(deps, invocation))
|
||||
if report != nil {
|
||||
|
||||
Reference in New Issue
Block a user