diff --git a/docs/cli.md b/docs/cli.md index f7fc0c6..f0ac951 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -413,6 +413,7 @@ Removed command paths have no compatibility aliases. | Previous invocation | Current invocation | | --- | --- | +| `session validate SESSION` | `preflight SESSION` | | `run-stage STAGE SESSION` | `run SESSION --stage STAGE` | | `analyze SESSION` | `run SESSION --stage analyze --force` | | `publish SESSION` | `run SESSION --stage publish --force` | @@ -425,6 +426,10 @@ Removed command paths have no compatibility aliases. | `--secrets-dir PATH` | Configure the main pipeline file or supply environment values; see [Secrets Handling](config.md#secrets-handling). | | `config diff LEFT_OVERLAY RIGHT_OVERLAY` | `config diff --overlay LEFT_OVERLAY --against-overlay RIGHT_OVERLAY` | +Unlike the former `session validate`, `preflight` prepares or reuses inputs and +can create workspace state, download inputs, and update the manifest. See +[preflight](#preflight) for its readiness-check behavior. + Campaign identity and file selectors may now accompany each other. Party-file selection consistently overrides the roster without editing campaign settings. Native configuration inspection retains declarations and their actual evidence; diff --git a/internal/app/clean_command.go b/internal/app/clean_command.go index 0d307a1..cee23fa 100644 --- a/internal/app/clean_command.go +++ b/internal/app/clean_command.go @@ -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 }), diff --git a/internal/app/execution_command.go b/internal/app/execution_command.go index 0b135b0..65f0db0 100644 --- a/internal/app/execution_command.go +++ b/internal/app/execution_command.go @@ -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 { diff --git a/internal/app/session_state_command.go b/internal/app/session_state_command.go index a27a8ab..6f2b3f6 100644 --- a/internal/app/session_state_command.go +++ b/internal/app/session_state_command.go @@ -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 {