Implement Scriptorium session recap analysis
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/adapters/analyzer"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/adapters/notify"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/adapters/storage"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/artifacts"
|
||||
@@ -51,25 +50,6 @@ func (s placeholderStage) Run(ctx context.Context, env *Env, m *manifest.Manifes
|
||||
paths := env.ArtifactStore.SessionPaths(sessionID)
|
||||
|
||||
switch s.name {
|
||||
case "analyze":
|
||||
if env.Analyzer != nil {
|
||||
req := analyzer.AnalyzeRequest{
|
||||
ArtifactType: "session-log",
|
||||
ProcessedTranscriptPath: filepath.Join(paths.TranscriptsDir, "processed.json"),
|
||||
ContextReferences: []string{"previous-session"},
|
||||
OutputPath: filepath.Join(paths.ArtifactsDir, "session-log.md"),
|
||||
GeneratedConfigPath: filepath.Join(paths.ConfigDir, "analyzer.session-log.generated.yml"),
|
||||
StdoutLogPath: filepath.Join(paths.LogsDir, "analyzer.session-log.stdout.log"),
|
||||
StderrLogPath: filepath.Join(paths.LogsDir, "analyzer.session-log.stderr.log"),
|
||||
}
|
||||
resp, err := env.Analyzer.Run(ctx, req)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("placeholder analyze adapter call failed: %w", err)
|
||||
}
|
||||
result.Outputs = append(result.Outputs, artifacts.Ref{Kind: "artifact", Category: "artifacts", SessionID: sessionID, AbsolutePath: resp.ArtifactPath})
|
||||
result.Logs = append(result.Logs, req.StdoutLogPath, req.StderrLogPath)
|
||||
result.GeneratedConfigs = append(result.GeneratedConfigs, req.GeneratedConfigPath)
|
||||
}
|
||||
case "archive":
|
||||
if env.Storage != nil {
|
||||
req := storage.ArchiveRequest{
|
||||
@@ -113,7 +93,7 @@ func All() []Stage {
|
||||
placeholderStage{name: "normalize"},
|
||||
mergeStage{},
|
||||
polishStage{},
|
||||
placeholderStage{name: "analyze"},
|
||||
analyzeStage{},
|
||||
placeholderStage{name: "archive"},
|
||||
placeholderStage{name: "notify"},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user