Removed legacy transcript artifact aliases
This commit is contained in:
@@ -224,9 +224,6 @@ Defaults listed here are effective runtime defaults after load.
|
||||
Allowed `pipeline.scriptorium.artifacts.<name>.inputs.<key>.source` values:
|
||||
|
||||
- `previous_session_artifact`
|
||||
- `processed_transcript`
|
||||
- `normalized_transcript`
|
||||
- `trimmed_transcript`
|
||||
- `narratio.transcript.merged`
|
||||
- `narratio.transcript.polished`
|
||||
- `narratio.transcript.full`
|
||||
|
||||
@@ -44,11 +44,6 @@ Supported canonical IDs and current mappings:
|
||||
| `narratio.bounds.session` | `artifacts/session_bounds.json` | `trim` | `session_bounds` |
|
||||
| `narratio.artifact.session_recap` | `artifacts/session_recap.md` | `analyze` | `session_recap` |
|
||||
|
||||
Legacy aliases normalized by resolver:
|
||||
- `processed_transcript` -> `narratio.transcript.polished`
|
||||
- `normalized_transcript` -> `narratio.transcript.full`
|
||||
- `trimmed_transcript` -> `narratio.transcript.trimmed`
|
||||
|
||||
Resolution order:
|
||||
1. Session manifest producer-stage outputs (if readable/valid).
|
||||
2. Canonical session path fallback.
|
||||
|
||||
@@ -662,7 +662,7 @@ func TestAdapterBackedStageFailureMarksManifestFailed(t *testing.T) {
|
||||
PromptID: "dnd.session_recap",
|
||||
OutputPath: "artifacts/session_recap.md",
|
||||
Inputs: map[string]config.ScriptoriumInputConfig{
|
||||
"transcript": {Source: "processed_transcript", Required: true},
|
||||
"transcript": {Source: "narratio.transcript.polished", Required: true},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -84,12 +84,6 @@ var artifactRegistry = map[string]artifactSpec{
|
||||
},
|
||||
}
|
||||
|
||||
var artifactAliases = map[string]string{
|
||||
"processed_transcript": ArtifactTranscriptPolished,
|
||||
"normalized_transcript": ArtifactTranscriptFull,
|
||||
"trimmed_transcript": ArtifactTranscriptTrimmed,
|
||||
}
|
||||
|
||||
// ResolvedSessionArtifact describes one session-level artifact lookup result.
|
||||
type ResolvedSessionArtifact struct {
|
||||
ID string
|
||||
@@ -113,15 +107,12 @@ func (e *SessionArtifactNotFoundError) Unwrap() error {
|
||||
return ErrSessionArtifactNotFound
|
||||
}
|
||||
|
||||
// NormalizeSessionArtifactSource maps legacy aliases to canonical IDs and validates IDs.
|
||||
// NormalizeSessionArtifactSource validates canonical artifact IDs.
|
||||
func NormalizeSessionArtifactSource(source string) (string, error) {
|
||||
normalized := strings.TrimSpace(source)
|
||||
if normalized == "" {
|
||||
return "", fmt.Errorf("artifact source is required")
|
||||
}
|
||||
if alias, ok := artifactAliases[normalized]; ok {
|
||||
normalized = alias
|
||||
}
|
||||
if _, ok := artifactRegistry[normalized]; !ok {
|
||||
return "", fmt.Errorf("unsupported artifact source %q", source)
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ func TestNormalizeSessionArtifactSource(t *testing.T) {
|
||||
wantID string
|
||||
wantErr string
|
||||
}{
|
||||
{name: "legacy alias processed", source: "processed_transcript", wantID: ArtifactTranscriptPolished},
|
||||
{name: "legacy alias normalized", source: "normalized_transcript", wantID: ArtifactTranscriptFull},
|
||||
{name: "legacy alias trimmed", source: "trimmed_transcript", wantID: ArtifactTranscriptTrimmed},
|
||||
{name: "legacy alias processed unsupported", source: "processed_transcript", wantErr: "unsupported artifact source"},
|
||||
{name: "legacy alias normalized unsupported", source: "normalized_transcript", wantErr: "unsupported artifact source"},
|
||||
{name: "legacy alias trimmed unsupported", source: "trimmed_transcript", wantErr: "unsupported artifact source"},
|
||||
{name: "canonical", source: ArtifactTranscriptTrimmed, wantID: ArtifactTranscriptTrimmed},
|
||||
{name: "unsupported", source: "narratio.unknown", wantErr: "unsupported artifact source"},
|
||||
}
|
||||
@@ -67,7 +67,7 @@ func TestResolveSessionArtifactPrefersManifestOutput(t *testing.T) {
|
||||
{Kind: "transcript_normalized", LocalPath: manifestPath, ProducerRunID: "run-123"},
|
||||
})
|
||||
|
||||
resolved, err := ResolveSessionArtifact(paths, m, "normalized_transcript")
|
||||
resolved, err := ResolveSessionArtifact(paths, m, ArtifactTranscriptFull)
|
||||
if err != nil {
|
||||
t.Fatalf("ResolveSessionArtifact() error = %v", err)
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ func TestScriptoriumLoadAndValidate(t *testing.T) {
|
||||
output_path: artifacts/session_recap.md
|
||||
inputs:
|
||||
transcript:
|
||||
source: processed_transcript
|
||||
source: narratio.transcript.polished
|
||||
required: true
|
||||
vars:
|
||||
session_id: true
|
||||
@@ -104,7 +104,7 @@ func TestScriptoriumLoadAndValidate(t *testing.T) {
|
||||
output_path: artifacts/session_recap.md
|
||||
inputs:
|
||||
transcript:
|
||||
source: processed_transcript
|
||||
source: narratio.transcript.polished
|
||||
required: true
|
||||
previous_recap:
|
||||
source: previous_session_artifact
|
||||
@@ -160,7 +160,7 @@ func TestScriptoriumLoadAndValidate(t *testing.T) {
|
||||
output_path: artifacts/session_recap.md
|
||||
inputs:
|
||||
transcript:
|
||||
source: processed_transcript
|
||||
source: narratio.transcript.polished
|
||||
required: true
|
||||
`,
|
||||
assert: func(t *testing.T, cfg *Config) {
|
||||
@@ -182,7 +182,7 @@ func TestScriptoriumLoadAndValidate(t *testing.T) {
|
||||
output_path: artifacts/session_recap.md
|
||||
inputs:
|
||||
transcript:
|
||||
source: processed_transcript
|
||||
source: narratio.transcript.polished
|
||||
required: true
|
||||
player_summary:
|
||||
enabled: true
|
||||
@@ -192,7 +192,7 @@ func TestScriptoriumLoadAndValidate(t *testing.T) {
|
||||
timeout: 3m
|
||||
inputs:
|
||||
transcript:
|
||||
source: processed_transcript
|
||||
source: narratio.transcript.polished
|
||||
required: true
|
||||
`,
|
||||
assert: func(t *testing.T, cfg *Config) {
|
||||
|
||||
@@ -443,12 +443,6 @@ func isSupportedScriptoriumInputSource(source string) bool {
|
||||
switch strings.TrimSpace(source) {
|
||||
case "previous_session_artifact":
|
||||
return true
|
||||
case "processed_transcript":
|
||||
return true
|
||||
case "normalized_transcript":
|
||||
return true
|
||||
case "trimmed_transcript":
|
||||
return true
|
||||
case "narratio.transcript.merged":
|
||||
return true
|
||||
case "narratio.transcript.polished":
|
||||
|
||||
@@ -231,7 +231,7 @@ func TestAnalyzeOmitsOptionalPreviousRecapWhenUnavailable(t *testing.T) {
|
||||
Timeout: "2m",
|
||||
Inputs: map[string]config.ScriptoriumInputConfig{
|
||||
"transcript": {
|
||||
Source: "processed_transcript",
|
||||
Source: "narratio.transcript.polished",
|
||||
Required: true,
|
||||
},
|
||||
"previous_recap": {
|
||||
@@ -358,7 +358,7 @@ func TestAnalyzeIncludesPreviousRecapWhenConfiguredAndAvailable(t *testing.T) {
|
||||
Timeout: "2m",
|
||||
Inputs: map[string]config.ScriptoriumInputConfig{
|
||||
"transcript": {
|
||||
Source: "processed_transcript",
|
||||
Source: "narratio.transcript.polished",
|
||||
Required: true,
|
||||
},
|
||||
"previous_recap": {
|
||||
@@ -394,7 +394,7 @@ func TestAnalyzeFailsWhenRequiredPreviousRecapMissing(t *testing.T) {
|
||||
OutputPath: "artifacts/session_recap.md",
|
||||
Inputs: map[string]config.ScriptoriumInputConfig{
|
||||
"transcript": {
|
||||
Source: "processed_transcript",
|
||||
Source: "narratio.transcript.polished",
|
||||
Required: true,
|
||||
},
|
||||
"previous_recap": {
|
||||
@@ -456,7 +456,7 @@ func TestAnalyzeSupportsProcessedTranscriptSourceWhenConfigured(t *testing.T) {
|
||||
|
||||
artifact := env.Config.Pipeline.Scriptorium.Artifacts["session_recap"]
|
||||
artifact.Inputs["transcript"] = config.ScriptoriumInputConfig{
|
||||
Source: "processed_transcript",
|
||||
Source: "narratio.transcript.polished",
|
||||
Required: true,
|
||||
}
|
||||
env.Config.Pipeline.Scriptorium.Artifacts["session_recap"] = artifact
|
||||
@@ -505,7 +505,7 @@ func TestAnalyzeSupportsNormalizedTranscriptSourceWhenConfigured(t *testing.T) {
|
||||
|
||||
artifact := env.Config.Pipeline.Scriptorium.Artifacts["session_recap"]
|
||||
artifact.Inputs["transcript"] = config.ScriptoriumInputConfig{
|
||||
Source: "normalized_transcript",
|
||||
Source: "narratio.transcript.full",
|
||||
Required: true,
|
||||
}
|
||||
env.Config.Pipeline.Scriptorium.Artifacts["session_recap"] = artifact
|
||||
@@ -565,7 +565,7 @@ func TestAnalyzeSupportsNormalizedTranscriptSourceFromManifestOutput(t *testing.
|
||||
|
||||
artifact := env.Config.Pipeline.Scriptorium.Artifacts["session_recap"]
|
||||
artifact.Inputs["transcript"] = config.ScriptoriumInputConfig{
|
||||
Source: "normalized_transcript",
|
||||
Source: "narratio.transcript.full",
|
||||
Required: true,
|
||||
}
|
||||
env.Config.Pipeline.Scriptorium.Artifacts["session_recap"] = artifact
|
||||
@@ -586,7 +586,7 @@ func TestAnalyzeFailsWhenNormalizedTranscriptMissing(t *testing.T) {
|
||||
env, m, fake := setupAnalyzeEnv(t)
|
||||
artifact := env.Config.Pipeline.Scriptorium.Artifacts["session_recap"]
|
||||
artifact.Inputs["transcript"] = config.ScriptoriumInputConfig{
|
||||
Source: "normalized_transcript",
|
||||
Source: "narratio.transcript.full",
|
||||
Required: true,
|
||||
}
|
||||
env.Config.Pipeline.Scriptorium.Artifacts["session_recap"] = artifact
|
||||
@@ -744,7 +744,7 @@ func setupAnalyzeEnv(t *testing.T) (*Env, *manifest.Manifest, *scriptorium.FakeR
|
||||
Timeout: "2m",
|
||||
Inputs: map[string]config.ScriptoriumInputConfig{
|
||||
"transcript": {
|
||||
Source: "trimmed_transcript",
|
||||
Source: "narratio.transcript.trimmed",
|
||||
Required: true,
|
||||
},
|
||||
"previous_recap": {
|
||||
|
||||
Reference in New Issue
Block a user