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

@@ -43,9 +43,9 @@ type preparedSuite[I, S any] struct {
// Command eagerly captures a configuration suite as a root-only config family.
// It copies suite slices, retains callback references, and returns a reusable
// declaration; installation does not invoke factories or providers. During an
// inspection, it creates separate input for each selected scope, validates
// those inputs before acquisition, and creates shared state once for that
// invocation.
// inspection, it initializes input separately for each selected scope and
// validates those inputs before acquisition. Suite documents factory timing,
// zero values, shared state, and caller ownership of returned objects.
func Command[I, S any](suite Suite[I, S]) commandkit.Command {
prepared := captureSuite(suite)
if len(prepared.scopes) == 0 {