Implement Scriptorium session recap analysis

This commit is contained in:
2026-05-06 21:26:54 +00:00
parent f94590f70e
commit 1ea24accd1
7 changed files with 901 additions and 38 deletions

View File

@@ -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"},
}