Reuse supplied completion in plans and runs

This commit is contained in:
2026-12-02 15:23:39 +00:00
parent 9367c7b713
commit 6e74b436f6
11 changed files with 336 additions and 22 deletions

View File

@@ -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