Add stage planning and placeholder runner
This commit is contained in:
@@ -9,15 +9,17 @@ import (
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/config"
|
||||
)
|
||||
|
||||
// Run validates configuration inputs and reports readiness for future execution.
|
||||
func Run(_ context.Context, args []string, out io.Writer) error {
|
||||
// Run executes the placeholder stage pipeline and persists manifest state.
|
||||
func Run(ctx context.Context, args []string, out io.Writer) error {
|
||||
fs := flag.NewFlagSet("run", flag.ContinueOnError)
|
||||
fs.SetOutput(io.Discard)
|
||||
|
||||
var pipelinePath string
|
||||
var sessionPath string
|
||||
var force bool
|
||||
fs.StringVar(&pipelinePath, "config", "", "path to pipeline.yml")
|
||||
fs.StringVar(&sessionPath, "session", "", "path to session.yml")
|
||||
fs.BoolVar(&force, "force", false, "force stage execution (reserved for future behavior)")
|
||||
|
||||
if err := fs.Parse(args); err != nil {
|
||||
return fmt.Errorf("run: invalid flags: %w", err)
|
||||
@@ -37,6 +39,12 @@ func Run(_ context.Context, args []string, out io.Writer) error {
|
||||
return fmt.Errorf("run: %w", err)
|
||||
}
|
||||
|
||||
_, err = fmt.Fprintln(out, "narratio run: configuration loaded and valid")
|
||||
stages := BuildFullPlan()
|
||||
summary, err := executeStages(ctx, cfg, stages, RunOptions{Force: force})
|
||||
if err != nil {
|
||||
return fmt.Errorf("run: %w", err)
|
||||
}
|
||||
|
||||
_, err = fmt.Fprintf(out, "narratio run: completed %d placeholder stages for session %s; manifest updated at %s\n", len(summary.StageNames), summary.SessionID, summary.ManifestPath)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user