diff --git a/docs/internal/adapters.md b/docs/internal/adapters.md index a41486f..a04c784 100644 --- a/docs/internal/adapters.md +++ b/docs/internal/adapters.md @@ -66,8 +66,10 @@ prepared reference resolution, receipt, bundle, and configured-lane policy. The adapter validates the ordered selector/absolute-path pairs and is the sole owner of serializing them as repeated `--reference` arguments before `--json`. -Object-store construction goes through `newCommandObjectStore`, which loads -configured filesystem secrets before adapter initialization. +Application-owned object-store construction loads configured filesystem +secrets before invoking the invocation's storage factory. Production commands +use the concrete storage adapter constructor; focused tests can supply an +in-memory backend without changing package state. ## Failure Semantics diff --git a/docs/internal/command-restore.md b/docs/internal/command-restore.md index a2eb4ef..546a158 100644 --- a/docs/internal/command-restore.md +++ b/docs/internal/command-restore.md @@ -11,6 +11,11 @@ physical restore scope belong in Restore separates remote authority, local conflict policy, and filesystem mutation so each remains testable independently. +The public command supplies production defaults to one private, +invocation-scoped dependency value. Discovery, planning, and execution use that +same value, so focused sequencing tests can replace one boundary without +mutable package hooks. + ## Discovery Contract Discovery delegates current-state pointer and manifest loading to @@ -118,4 +123,5 @@ Audio restore path: - Tests: `internal/app/restore_discovery_test.go`, `internal/app/restore_plan_test.go`, `internal/app/restore_execution_test.go`, + `internal/app/restore_recovery_test.go`, `internal/app/restore_workflow_test.go` diff --git a/docs/internal/overview.md b/docs/internal/overview.md index ca5b6bd..524dae5 100644 --- a/docs/internal/overview.md +++ b/docs/internal/overview.md @@ -52,6 +52,13 @@ Narratio-level contracts; external transport and SDK details remain in adapters. The normative rules for these relationships remain in [Architecture](../policy/architecture.md). +Command execution normalizes one private dependency value per invocation. +Configuration reads, secret-directory reads, remote downloads, object-store +construction, and restore phase functions use that value throughout the +command. Public command entry points supply production defaults, while focused +tests replace only the external or sequencing boundary they exercise without +mutating package state. + Pipeline execution and `session plan` share the same inclusive contiguous-range model and the same pure pre-execution decision over recorded status, force, and normalized resume validation. Planning applies that decision and modeled diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index a946028..b7fde5e 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -350,7 +350,7 @@ occurred. ## Stage 6 — Verify Coverage, Align Internal Documentation, And Close The Roadmap -**Status:** Pending +**Status:** Completed ### Goal diff --git a/docs/roadmap/refactoring.md b/docs/roadmap/refactoring.md index d993c65..ffcacfa 100644 --- a/docs/roadmap/refactoring.md +++ b/docs/roadmap/refactoring.md @@ -463,7 +463,7 @@ cleanup-stage failure without republishing unchanged data. ### Workstream 10 — Quality, testability, and documentation alignment -**Status:** Pending (cross-cutting) +**Status:** Complete **Audit sources:** H07, H08, H12, H13, H17, H18, H23, H25, C01, C02, C03, C04, C05, and C06. diff --git a/internal/app/config_loader.go b/internal/app/config_loader.go index f191ed1..c65565b 100644 --- a/internal/app/config_loader.go +++ b/internal/app/config_loader.go @@ -34,10 +34,6 @@ func retainedCommandConfig(cfg *config.Config) *commandConfig { return &commandConfig{Config: cfg} } -func loadCommandConfig(ctx context.Context, pipelineFlag, campaignFlag, campaignFileFlag, sessionFlag string, sessionOpts config.SessionLoadOptions) (loaded *commandConfig, err error) { - return loadCommandConfigWithDependencies(ctx, pipelineFlag, campaignFlag, campaignFileFlag, sessionFlag, sessionOpts, commandDependencies{}) -} - func loadCommandConfigWithDependencies(ctx context.Context, pipelineFlag, campaignFlag, campaignFileFlag, sessionFlag string, sessionOpts config.SessionLoadOptions, deps commandDependencies) (loaded *commandConfig, err error) { deps = normalizeCommandDependencies(deps) var cleanup func() error @@ -139,10 +135,6 @@ func loadCommandConfigWithDependencies(ctx context.Context, pipelineFlag, campai return loaded, nil } -func loadPipelineCampaignConfig(pipelineFlag, campaignFlag, campaignFileFlag string, pipelineOpts config.PipelineLoadOptions) (*pipelineCampaignConfig, error) { - return loadPipelineCampaignConfigWithDependencies(pipelineFlag, campaignFlag, campaignFileFlag, pipelineOpts, commandDependencies{}) -} - func loadPipelineCampaignConfigWithDependencies(pipelineFlag, campaignFlag, campaignFileFlag string, pipelineOpts config.PipelineLoadOptions, deps commandDependencies) (*pipelineCampaignConfig, error) { deps = normalizeCommandDependencies(deps) loadedPipelinePath, pipelineCfg, err := loadPipelineConfigWithDependencies(pipelineFlag, pipelineOpts, deps) diff --git a/internal/app/object_store.go b/internal/app/object_store.go index 54e4dca..f230e42 100644 --- a/internal/app/object_store.go +++ b/internal/app/object_store.go @@ -9,10 +9,6 @@ import ( "gitea.maximumdirect.net/eric/narratio/internal/config" ) -func newCommandObjectStore(ctx context.Context, cfg *config.Config, logger *slog.Logger) (storage.ObjectStore, error) { - return newCommandObjectStoreWithDependencies(ctx, cfg, logger, commandDependencies{}) -} - func newCommandObjectStoreWithDependencies(ctx context.Context, cfg *config.Config, logger *slog.Logger, deps commandDependencies) (storage.ObjectStore, error) { deps = normalizeCommandDependencies(deps) if _, err := loadSecretsFromConfigWithDependencies(cfg, logger, deps); err != nil { diff --git a/internal/app/operator_inspection.go b/internal/app/operator_inspection.go index c17157f..9cc3ebb 100644 --- a/internal/app/operator_inspection.go +++ b/internal/app/operator_inspection.go @@ -183,10 +183,6 @@ func inspectPreviousArtifactReadiness( return out } -func inspectRemoteCurrentState(ctx context.Context, cfg *config.Config, store storage.ObjectStore) remoteCurrentStateCheck { - return inspectRemoteCurrentStateWithDependencies(ctx, cfg, store, commandDependencies{}) -} - func inspectRemoteCurrentStateWithDependencies(ctx context.Context, cfg *config.Config, store storage.ObjectStore, deps commandDependencies) remoteCurrentStateCheck { if store == nil { return remoteCurrentStateCheck{}