Initialize narratio Go module and CLI scaffold

This commit is contained in:
2026-05-02 10:37:38 -05:00
parent 48c51e1c77
commit 902e6bc994
42 changed files with 1486 additions and 1 deletions

2
internal/manifest/doc.go Normal file
View File

@@ -0,0 +1,2 @@
// Package manifest defines durable run-state tracking for narratio sessions.
package manifest

View File

@@ -0,0 +1,18 @@
package manifest
import "time"
// StageState tracks status and metadata for one stage execution.
type StageState struct {
Status StageStatus
UpdatedAt time.Time
Error string
}
// Manifest is the durable state record for a session run.
type Manifest struct {
SessionID string
CreatedAt time.Time
UpdatedAt time.Time
Stages map[string]StageState
}

View File

@@ -0,0 +1,14 @@
package manifest
// StageStatus is the lifecycle state of a pipeline stage.
type StageStatus string
const (
StatusPending StageStatus = "pending"
StatusRunning StageStatus = "running"
StatusSucceeded StageStatus = "succeeded"
StatusFailed StageStatus = "failed"
StatusSkipped StageStatus = "skipped"
StatusStale StageStatus = "stale"
StatusInterrupted StageStatus = "interrupted"
)

View File

@@ -0,0 +1,27 @@
package manifest
import (
"context"
"fmt"
)
// Store is a placeholder interface for manifest persistence.
type Store interface {
Load(ctx context.Context, sessionID string) (*Manifest, error)
Save(ctx context.Context, m *Manifest) error
}
// LocalStore is a placeholder local-filesystem manifest store.
type LocalStore struct {
RootDir string
}
// Load returns a not-yet-implemented error in the scaffold.
func (s *LocalStore) Load(_ context.Context, _ string) (*Manifest, error) {
return nil, fmt.Errorf("manifest local load: not yet implemented")
}
// Save returns a not-yet-implemented error in the scaffold.
func (s *LocalStore) Save(_ context.Context, _ *Manifest) error {
return fmt.Errorf("manifest local save: not yet implemented")
}