From 6e74b436f6f5c79f653e4d926eaec2e09f60f07d Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Wed, 2 Dec 2026 15:23:39 +0000 Subject: [PATCH] Reuse supplied completion in plans and runs --- docs/internal/manifest.md | 20 ++- docs/roadmap/implementation.md | 2 +- internal/app/bounded_prerequisites.go | 9 +- internal/app/bounded_prerequisites_test.go | 8 +- internal/app/plan.go | 5 + internal/app/plan_command.go | 2 +- internal/app/runner_runtime.go | 2 +- internal/app/runner_stage_execution.go | 6 + internal/app/supplied_completion.go | 72 ++++++++ internal/app/supplied_completion_test.go | 197 +++++++++++++++++++++ internal/artifacts/supplied.go | 35 +++- 11 files changed, 336 insertions(+), 22 deletions(-) create mode 100644 internal/app/supplied_completion.go create mode 100644 internal/app/supplied_completion_test.go diff --git a/docs/internal/manifest.md b/docs/internal/manifest.md index 7eb7ac6..7fc1277 100644 --- a/docs/internal/manifest.md +++ b/docs/internal/manifest.md @@ -23,8 +23,10 @@ Supplied records hold a canonical session-relative path, SHA-256 checksum, byte size, and optional product contract. The manifest store validates their structure; artifact helpers check the recorded path and actual content. A separate coverage helper derives transcript work satisfied by valid supplied -transcripts without creating records for absent intermediate products. These -foundations are not yet connected to restore or execution decisions. +transcripts without creating records for absent intermediate products. Planning +and execution use that coverage to reuse satisfied transcript work without +historical producer evidence. Restore installation is described in its roadmap +until the inventory cutover is implemented. Session, campaign, and run identities in local and downloaded manifests must be portable opaque segments. Unsafe legacy identities are rejected with migration @@ -274,6 +276,13 @@ cannot contain outputs. An intentional self-skip records the current semantic fingerprint because it is a completed, reusable stage result; failed or interrupted work never promotes one. +Supplied completion is revalidated against local bytes before planning or +execution reuses it. It can satisfy transcript work through the supplied JSON, +selected render outputs, or a complete configured extraction set. An attempted +replacement retires the supplied authority for its affected products before +execution; forced work therefore cannot revive an earlier supplied result. +Coverage never makes an absent consumer input available. + When an already-succeeded stage is skipped, the session manifest deliberately retains its existing succeeded record because it remains the cross-invocation progress authority. If a stage supplies semantic configuration evidence, reuse first @@ -331,8 +340,11 @@ values that cannot affect canonical results. Concrete coverage is owned by the focused stage and integration documents linked above. Before an explicitly bounded execution starts after `prepare`, the application -reads the session manifest and accepts only `succeeded` or `skipped` for every -excluded canonical prefix stage. The first other status or absent record fails +reads the session manifest and checks excluded canonical prefix stages. Valid +supplied transcript coverage satisfies the corresponding producer work; in that +context prepare and the independent render and extract stages do not block a +downstream selection. Other excluded stages require `succeeded` or `skipped`. +The first other status or absent record fails the request before layout mutation, adapter initialization, session-manifest writes, or run-directory creation. Excluded prefix records are not passed to resume validators. Records after the selected end are not prerequisites and diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index 5f00573..b9f6aa1 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -211,7 +211,7 @@ Validation: `go test ./internal/stage ./internal/artifacts ./internal/manifest`. ## Stage 5: Share supplied completion across planning and execution -Status: Pending +Status: Complete Read `internal/app/semantic_resume.go`, `plan.go`, `runner_stage_execution.go`, `run_control.go`, bounded prerequisites, and diff --git a/internal/app/bounded_prerequisites.go b/internal/app/bounded_prerequisites.go index 708c80c..d2a49e4 100644 --- a/internal/app/bounded_prerequisites.go +++ b/internal/app/bounded_prerequisites.go @@ -9,11 +9,16 @@ import ( "gitea.maximumdirect.net/eric/narratio/internal/manifest" ) -func validateBoundedPrerequisites(plan BoundedPlan, m *manifest.Manifest) error { +func validateBoundedPrerequisites(plan BoundedPlan, m *manifest.Manifest, cfg *config.Config) error { if !plan.HasExplicitBounds() { return nil } + coverage := suppliedCompletion(cfg, m) + hasTranscript := coverage["transcribe"] for _, name := range plan.PrefixNames() { + if coverage[name] || (hasTranscript && (name == "prepare" || name == "render" || name == "extract")) { + continue + } status := "absent" if m != nil && m.Stages != nil && m.Stages[name] != nil { stageStatus := m.Stages[name].Status @@ -58,5 +63,5 @@ func inspectBoundedPrerequisites(ctx context.Context, cfg *config.Config, plan B if !present { m = nil } - return validateBoundedPrerequisites(plan, m) + return validateBoundedPrerequisites(plan, m, cfg) } diff --git a/internal/app/bounded_prerequisites_test.go b/internal/app/bounded_prerequisites_test.go index fa352bb..1866cbb 100644 --- a/internal/app/bounded_prerequisites_test.go +++ b/internal/app/bounded_prerequisites_test.go @@ -37,7 +37,7 @@ func TestValidateBoundedPrerequisitesRejectsFirstUnusablePrefixStatus(t *testing } // A later terminal prefix must not hide the first unusable one. m.MarkStageSucceeded("transcribe", now, nil) - err := validateBoundedPrerequisites(plan, m) + err := validateBoundedPrerequisites(plan, m, nil) if err == nil { t.Fatal("validateBoundedPrerequisites() error = nil") } @@ -60,14 +60,14 @@ func TestValidateBoundedPrerequisitesAcceptsSucceededAndSkippedPrefix(t *testing m.MarkStageSkipped(name, time.Now().UTC(), "not applicable") } } - if err := validateBoundedPrerequisites(plan, m); err != nil { + if err := validateBoundedPrerequisites(plan, m, nil); err != nil { t.Fatalf("validateBoundedPrerequisites() error = %v", err) } } func TestValidateBoundedPrerequisitesHasNoPrefixAtPrepareAndIgnoresSuffix(t *testing.T) { preparePlan := mustBoundedPlan(t, "prepare", "prepare") - if err := validateBoundedPrerequisites(preparePlan, nil); err != nil { + if err := validateBoundedPrerequisites(preparePlan, nil, nil); err != nil { t.Fatalf("prepare prerequisite validation error = %v", err) } @@ -75,7 +75,7 @@ func TestValidateBoundedPrerequisitesHasNoPrefixAtPrepareAndIgnoresSuffix(t *tes m := manifest.New("session", time.Now().UTC()) markPrefixSucceeded(m, renderPlan) m.MarkStageFailed("analyze", time.Now().UTC(), "later failure") - if err := validateBoundedPrerequisites(renderPlan, m); err != nil { + if err := validateBoundedPrerequisites(renderPlan, m, nil); err != nil { t.Fatalf("suffix status affected prerequisite validation: %v", err) } } diff --git a/internal/app/plan.go b/internal/app/plan.go index fce97a7..2e8e012 100644 --- a/internal/app/plan.go +++ b/internal/app/plan.go @@ -37,6 +37,7 @@ func modelPlannedStageRun( decision preExecutionDecision, semanticConfig *manifest.SemanticConfigFingerprint, ) error { + retireSuppliedForAttempt(cfg, model, selectedStage.Name()) prior := capturePriorStageOutcome(model, selectedStage.Name()) at := time.Now().UTC() if _, err := beginStageAttempt(model, selectedStage.Name(), decision, at); err != nil { @@ -90,6 +91,10 @@ func projectSelectedWork(ctx context.Context, cfg *config.Config, plan BoundedPl if err := ctx.Err(); err != nil { return projection, err } + if !force && suppliedCompletion(cfg, model)[selectedStage.Name()] { + projection.Stages = append(projection.Stages, projectedStage{Name: selectedStage.Name(), Decision: preExecutionDecision{action: stageActionSkip}, Reason: "satisfied by supplied product"}) + continue + } semanticConfig, err := currentStageSemanticConfig(selectedStage, stageEnv) if err != nil { return nil, fmt.Errorf("plan: fingerprint semantic configuration for stage %q: %w", selectedStage.Name(), err) diff --git a/internal/app/plan_command.go b/internal/app/plan_command.go index 5dc567f..379bc95 100644 --- a/internal/app/plan_command.go +++ b/internal/app/plan_command.go @@ -100,7 +100,7 @@ func buildSessionPlan(ctx context.Context, cfg *config.Config, input *executionI if err != nil { return nil, fmt.Errorf("plan: %w", err) } - if err := validateBoundedPrerequisites(input.plan, m); err != nil { + if err := validateBoundedPrerequisites(input.plan, m, cfg); err != nil { return nil, fmt.Errorf("plan: %w", err) } var objectStore storage.ObjectStore diff --git a/internal/app/runner_runtime.go b/internal/app/runner_runtime.go index 4f8d7be..45d851a 100644 --- a/internal/app/runner_runtime.go +++ b/internal/app/runner_runtime.go @@ -162,7 +162,7 @@ func initializeLockedInvocation(runtime *invocationRuntime) error { // The unlocked inspection avoids creating invocation state for an invalid // request. Recheck while holding the session lock in case prior state changed. - if err := validateBoundedPrerequisites(runtime.plan, m); err != nil { + if err := validateBoundedPrerequisites(runtime.plan, m, runtime.cfg); err != nil { return fmt.Errorf("validate bounded run prerequisites under session lock: %w", err) } runtime.started = true diff --git a/internal/app/runner_stage_execution.go b/internal/app/runner_stage_execution.go index 5ef2e0b..4a9d3bc 100644 --- a/internal/app/runner_stage_execution.go +++ b/internal/app/runner_stage_execution.go @@ -38,6 +38,11 @@ func executeSelectedStage(runtime *invocationRuntime, selected stage.Stage) (out } } env.Force = runtime.opts.Force + if !runtime.opts.Force && suppliedCompletion(env.Config, m)[selected.Name()] { + env.Info("stage reuse decision", "stage", selected.Name(), "reason", "supplied_product") + env.Progress("reusing stage", "stage", selected.Name()) + return stageExecutionOutcome{skipped: true, reused: true, reason: "supplied_product"}, nil + } semanticConfig, err := currentStageSemanticConfig(selected, env) if err != nil { @@ -79,6 +84,7 @@ func executeSelectedStage(runtime *invocationRuntime, selected stage.Stage) (out return outcome, err } + retireSuppliedForAttempt(env.Config, m, selected.Name()) priorOutcome := capturePriorStageOutcome(m, selected.Name()) outcome.executed = true startedAt := runtime.dependencies.now() diff --git a/internal/app/supplied_completion.go b/internal/app/supplied_completion.go new file mode 100644 index 0000000..93cbf72 --- /dev/null +++ b/internal/app/supplied_completion.go @@ -0,0 +1,72 @@ +package app + +import ( + "gitea.maximumdirect.net/eric/narratio/internal/artifactmodel" + "gitea.maximumdirect.net/eric/narratio/internal/artifacts" + "gitea.maximumdirect.net/eric/narratio/internal/config" + "gitea.maximumdirect.net/eric/narratio/internal/manifest" +) + +// suppliedCompletion examines actual accepted products without changing progress. +func suppliedCompletion(cfg *config.Config, m *manifest.Manifest) map[string]bool { + covered := map[string]bool{} + if cfg == nil || cfg.Pipeline == nil || cfg.Session == nil || m == nil || m.SuppliedProducts == nil { + return covered + } + paths := artifacts.NewLocalStore(cfg.Pipeline.Workspace.Root).SessionPathsFor(cfg.Session.Campaign, cfg.Session.SessionID) + covered = artifacts.SuppliedTranscriptCoverage(paths, m.SuppliedProducts) + render := cfg.Pipeline.Render + if render == nil || render.Enabled == nil || *render.Enabled { + selected := []string{"normalized", "trimmed"} + if render != nil { + selected = render.Variants + } + variants, err := artifactmodel.SelectRenderVariants(selected) + if err == nil { + complete := true + for _, variant := range variants { + record, ok := m.SuppliedProducts.Products[variant.OutputSource] + if !ok || artifacts.ValidateSuppliedProduct(paths, variant.OutputSource, variant.OutputPath, record) != nil { + complete = false + break + } + } + if complete { + covered["render"] = true + } + } + } + if cfg.Pipeline.Notarius != nil && cfg.Pipeline.Notarius.Enabled && artifacts.SuppliedExtractionComplete(paths, m, artifacts.ExtractionDefinitionsFromConfig(cfg.Pipeline.Notarius)) { + covered["extract"] = true + } + return covered +} + +// retireSuppliedForAttempt prevents older supplied completion from returning +// after a selected producer begins replacement work. +func retireSuppliedForAttempt(cfg *config.Config, m *manifest.Manifest, name string) { + if cfg == nil || cfg.Pipeline == nil || cfg.Session == nil || m == nil || m.SuppliedProducts == nil { + return + } + for source := range m.SuppliedProducts.Products { + remove := artifacts.SuppliedTranscriptSourceCovers(source, name) + if name == "render" { + selected := []string{"normalized", "trimmed"} + if cfg.Pipeline.Render != nil { + selected = cfg.Pipeline.Render.Variants + } + variants, _ := artifactmodel.SelectRenderVariants(selected) + for _, variant := range variants { + if source == variant.OutputSource { + remove = true + } + } + } + if name == "extract" && artifacts.IsExtractionArtifactSource(source) { + remove = true + } + if remove { + delete(m.SuppliedProducts.Products, source) + } + } +} diff --git a/internal/app/supplied_completion_test.go b/internal/app/supplied_completion_test.go new file mode 100644 index 0000000..c2ec110 --- /dev/null +++ b/internal/app/supplied_completion_test.go @@ -0,0 +1,197 @@ +package app + +import ( + "context" + "os" + "path/filepath" + "reflect" + "testing" + "time" + + "gitea.maximumdirect.net/eric/narratio/internal/artifacts" + "gitea.maximumdirect.net/eric/narratio/internal/config" + "gitea.maximumdirect.net/eric/narratio/internal/manifest" + "gitea.maximumdirect.net/eric/narratio/internal/stage" +) + +func suppliedCompletionFixture(t *testing.T) (*manifest.Manifest, *Env) { + t.Helper() + cfg := testConfig(t) + paths := artifacts.NewLocalStore(cfg.Pipeline.Workspace.Root).SessionPathsFor(cfg.Session.Campaign, cfg.Session.SessionID) + path := filepath.Join(paths.Root, filepath.FromSlash(artifacts.TranscriptPathFinalTrimmed)) + if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil { + t.Fatal(err) + } + body := []byte(`{"segments":[]}`) + if err := os.WriteFile(path, body, 0600); err != nil { + t.Fatal(err) + } + checksum, err := artifacts.SHA256File(path) + if err != nil { + t.Fatal(err) + } + m := manifest.New(cfg.Session.SessionID, time.Now().UTC()) + m.Campaign = cfg.Session.Campaign + m.SuppliedProducts = &manifest.SuppliedProductCollection{Version: manifest.SuppliedProductVersion, Products: map[string]manifest.SuppliedProduct{artifacts.ArtifactTranscriptFinalTrimmed: {Path: artifacts.TranscriptPathFinalTrimmed, Checksum: checksum, Size: int64(len(body))}}} + saveBoundedManifest(t, cfg, m) + return m, &Env{Config: cfg} +} + +func TestSuppliedTranscriptPlanAndBoundedExecution(t *testing.T) { + m, env := suppliedCompletionFixture(t) + cfg := env.Config + plan := mustBoundedPlan(t, "transcribe", "trim") + counts := 0 + plan.stages = []stage.Stage{countingStage{name: "transcribe", runs: &counts}, countingStage{name: "merge", runs: &counts}, countingStage{name: "polish", runs: &counts}, countingStage{name: "normalize", runs: &counts}, countingStage{name: "trim", runs: &counts}} + before, err := cloneManifestForPlan(m, cfg) + if err != nil { + t.Fatal(err) + } + projection, err := projectSelectedWork(context.Background(), cfg, plan, false, nil, artifacts.EffectiveArtifactSet{}, artifacts.NewLocalStore(cfg.Pipeline.Workspace.Root), nil, m) + if err != nil { + t.Fatal(err) + } + for _, entry := range projection.Stages { + if entry.Decision.action != stageActionSkip { + t.Fatalf("projection %+v", entry) + } + } + if !reflect.DeepEqual(before, m) { + t.Fatal("projection changed manifest") + } + result, err := executePlan(context.Background(), cfg, plan, RunOptions{}) + if err != nil { + t.Fatal(err) + } + if counts != 0 || len(result.Executed) != 0 { + t.Fatalf("calls %d, executed %v", counts, result.Executed) + } + if err := validateBoundedPrerequisites(mustBoundedPlan(t, "analyze", "analyze"), m, cfg); err != nil { + t.Fatal(err) + } +} + +func TestSuppliedCoverageRejectsTamperingAndForceRetiresAuthority(t *testing.T) { + m, env := suppliedCompletionFixture(t) + cfg := env.Config + if !suppliedCompletion(cfg, m)["trim"] { + t.Fatal("missing coverage") + } + path := filepath.Join(artifacts.SessionWorkDirForCampaign(cfg.Pipeline.Workspace.Root, cfg.Session.Campaign, cfg.Session.SessionID), filepath.FromSlash(artifacts.TranscriptPathFinalTrimmed)) + if err := os.WriteFile(path, []byte("tampered"), 0600); err != nil { + t.Fatal(err) + } + if suppliedCompletion(cfg, m)["trim"] { + t.Fatal("tampered coverage") + } + retireSuppliedForAttempt(cfg, m, "transcribe") + if len(m.SuppliedProducts.Products) != 0 { + t.Fatal("force retained superseded supplied record") + } +} + +func TestSuppliedTranscriptForcedRunMatchesPlan(t *testing.T) { + m, env := suppliedCompletionFixture(t) + cfg := env.Config + plan := mustBoundedPlan(t, "transcribe", "transcribe") + calls := 0 + plan.stages = []stage.Stage{countingStage{name: "transcribe", runs: &calls}} + projected, err := projectSelectedWork(context.Background(), cfg, plan, true, nil, artifacts.EffectiveArtifactSet{}, artifacts.NewLocalStore(cfg.Pipeline.Workspace.Root), nil, m) + if err != nil { + t.Fatal(err) + } + if projected.Stages[0].Decision.action != stageActionRun { + t.Fatalf("projection %+v", projected.Stages) + } + if len(projected.Model.SuppliedProducts.Products) != 0 || len(m.SuppliedProducts.Products) != 1 { + t.Fatal("force did not retire authority on the detached projection") + } + result, err := executePlan(context.Background(), cfg, plan, RunOptions{Force: true}) + if err != nil { + t.Fatal(err) + } + if calls != 1 || !reflect.DeepEqual(result.Executed, []string{"transcribe"}) { + t.Fatalf("calls %d result %+v", calls, result) + } + saved, err := (&manifest.LocalStore{}).Load(context.Background(), result.ManifestPath) + if err != nil { + t.Fatal(err) + } + if len(saved.SuppliedProducts.Products) != 0 { + t.Fatal("force retained supplied authority") + } +} + +func TestSuppliedTranscriptRealStagesReuseWithoutAdapters(t *testing.T) { + m, env := suppliedCompletionFixture(t) + cfg := env.Config + cfg.Pipeline.Audita.ProposalProfile = "changed-historical-profile" + plan := mustBoundedPlan(t, "transcribe", "trim") + projected, err := projectSelectedWork(context.Background(), cfg, plan, false, nil, artifacts.EffectiveArtifactSet{}, artifacts.NewLocalStore(cfg.Pipeline.Workspace.Root), nil, m) + if err != nil { + t.Fatal(err) + } + for _, decision := range projected.Stages { + if decision.Decision.action != stageActionSkip { + t.Fatalf("projected %+v", decision) + } + } + result, err := executePlan(context.Background(), cfg, plan, RunOptions{}) + if err != nil { + t.Fatal(err) + } + if len(result.Executed) != 0 { + t.Fatalf("unexpected execution %v", result.Executed) + } +} + +func TestSuppliedTranscriptFullPrefixPlanMatchesExecution(t *testing.T) { + m, env := suppliedCompletionFixture(t) + cfg := env.Config + plan := mustBoundedPlan(t, "", "trim") + prepareRuns := 0 + plan.stages[0] = countingStage{name: "prepare", runs: &prepareRuns} + projected, err := projectSelectedWork(context.Background(), cfg, plan, false, nil, artifacts.EffectiveArtifactSet{}, artifacts.NewLocalStore(cfg.Pipeline.Workspace.Root), nil, m) + if err != nil { + t.Fatal(err) + } + if projected.Stages[0].Decision.action != stageActionRun { + t.Fatalf("prepare decision %+v", projected.Stages[0]) + } + for _, decision := range projected.Stages[1:] { + if decision.Decision.action != stageActionSkip { + t.Fatalf("decision %+v", decision) + } + } + result, err := executePlan(context.Background(), cfg, plan, RunOptions{}) + if err != nil { + t.Fatal(err) + } + if prepareRuns != 1 || !reflect.DeepEqual(result.Executed, []string{"prepare"}) { + t.Fatalf("runs %d execution %v", prepareRuns, result.Executed) + } +} + +func TestSuppliedRenderCompletionFollowsSelection(t *testing.T) { + m, env := suppliedCompletionFixture(t) + cfg := env.Config + paths := artifacts.NewLocalStore(cfg.Pipeline.Workspace.Root).SessionPathsFor(cfg.Session.Campaign, cfg.Session.SessionID) + path := filepath.Join(paths.Root, filepath.FromSlash(artifacts.TranscriptPathFinalTrimmedMarkdown)) + body := []byte("trimmed markdown\n") + if err := os.WriteFile(path, body, 0600); err != nil { + t.Fatal(err) + } + checksum, err := artifacts.SHA256File(path) + if err != nil { + t.Fatal(err) + } + m.SuppliedProducts.Products[artifacts.ArtifactTranscriptFinalTrimmedMarkdown] = manifest.SuppliedProduct{Path: artifacts.TranscriptPathFinalTrimmedMarkdown, Checksum: checksum, Size: int64(len(body))} + cfg.Pipeline.Render = &config.RenderConfig{Variants: []string{"trimmed"}} + if !suppliedCompletion(cfg, m)["render"] { + t.Fatal("selected output not recognized") + } + cfg.Pipeline.Render.Variants = []string{"normalized", "trimmed"} + if suppliedCompletion(cfg, m)["render"] { + t.Fatal("missing selected output treated as complete") + } +} diff --git a/internal/artifacts/supplied.go b/internal/artifacts/supplied.go index d705169..cd9ad86 100644 --- a/internal/artifacts/supplied.go +++ b/internal/artifacts/supplied.go @@ -52,6 +52,31 @@ func ValidateSuppliedProduct(paths SessionPaths, source, canonicalPath string, r return nil } +var suppliedTranscriptWork = []struct { + source string + stages []string +}{ + {ArtifactTranscriptBase, []string{"transcribe", "merge"}}, + {ArtifactTranscriptPolished, []string{"transcribe", "merge", "polish"}}, + {ArtifactTranscriptFinal, []string{"transcribe", "merge", "polish", "normalize"}}, + {ArtifactTranscriptFinalTrimmed, []string{"transcribe", "merge", "polish", "normalize", "trim"}}, +} + +// SuppliedTranscriptSourceCovers reports the fixed relationship independently +// of current file validity, including when retiring superseded authority. +func SuppliedTranscriptSourceCovers(source, name string) bool { + for _, entry := range suppliedTranscriptWork { + if source == entry.source { + for _, stage := range entry.stages { + if stage == name { + return true + } + } + } + } + return false +} + // SuppliedTranscriptCoverage returns transcript work satisfied by valid supplied // products. It neither records nor creates the intermediate products. func SuppliedTranscriptCoverage(paths SessionPaths, collection *manifest.SuppliedProductCollection) map[string]bool { @@ -59,15 +84,7 @@ func SuppliedTranscriptCoverage(paths SessionPaths, collection *manifest.Supplie if collection == nil || manifest.ValidateSuppliedProducts(collection) != nil { return covered } - for _, entry := range []struct { - source string - stages []string - }{ - {ArtifactTranscriptBase, []string{"transcribe", "merge"}}, - {ArtifactTranscriptPolished, []string{"transcribe", "merge", "polish"}}, - {ArtifactTranscriptFinal, []string{"transcribe", "merge", "polish", "normalize"}}, - {ArtifactTranscriptFinalTrimmed, []string{"transcribe", "merge", "polish", "normalize", "trim"}}, - } { + for _, entry := range suppliedTranscriptWork { record, ok := collection.Products[entry.source] if !ok || ValidateSuppliedProduct(paths, entry.source, "", record) != nil { continue