Clarify inspection input ownership and documentation

This commit is contained in:
2026-10-11 13:07:00 +00:00
parent cec4da69d3
commit 7ce2fc0bf2
8 changed files with 67 additions and 27 deletions

View File

@@ -33,10 +33,17 @@ type ProfileRequest struct {
// Suite describes application-owned input, shared state, and named inspection
// capabilities. Its private issues retain adapter construction failures.
// Factory results and callback effects remain caller-owned: Command does not
// deep-copy arbitrary objects or repair aliases returned by factories.
// Factories are not invoked during construction, installation, help, or version,
// and need not run after failure.
type Suite[I, S any] struct {
// NewInput creates input storage once for the selected definition command.
// NewInput is called once when definition input preparation is reached,
// before applying selectors and calling CheckInput.
// If nil, input is the zero value of I, including nil for pointer types.
NewInput func() I
// NewState creates shared inspection state once for that invocation.
// NewState is called once when inspection is reached, after input checks
// pass. If nil, state is the zero value of S, including nil for pointer types.
NewState func() S
// Selectors declares the original typed flags accepted by definition commands.
Selectors []commandkit.Flag[I]