Initialize narratio Go module and CLI scaffold
This commit is contained in:
2
internal/manifest/doc.go
Normal file
2
internal/manifest/doc.go
Normal file
@@ -0,0 +1,2 @@
|
||||
// Package manifest defines durable run-state tracking for narratio sessions.
|
||||
package manifest
|
||||
18
internal/manifest/manifest.go
Normal file
18
internal/manifest/manifest.go
Normal 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
|
||||
}
|
||||
14
internal/manifest/status.go
Normal file
14
internal/manifest/status.go
Normal 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"
|
||||
)
|
||||
27
internal/manifest/store.go
Normal file
27
internal/manifest/store.go
Normal 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")
|
||||
}
|
||||
Reference in New Issue
Block a user