internal/formation/rebuild.go
internal/formation · 66 lines · 5 declarations · source
Declarations
var ErrGenerationInference
var ErrGenerationInference = errors.New("generation inference failed before cutover")
type Rebuilder
type Rebuilder struct {
facts *pg.FactStore
extractor *extract.Extractor
}
func NewRebuilder
func NewRebuilder(facts *pg.FactStore, extractor *extract.Extractor) *Rebuilder
method Rebuilder.Rebuild
func (r *Rebuilder) Rebuild(ctx context.Context, schema pg.Schema, scope, source, key, principal string) (pg.GenerationResult, error)
Rebuild prepares all output while the old facts remain available. The one-source transaction checks that nothing changed meanwhile, and commits a receipt keyed by the operator's request. An interrupted preparation can cost another model attempt; an interrupted published operation reuses its recorded outcome. Provider bodies never enter the operator's error output.
method Rebuilder.rebuild
func (r *Rebuilder) rebuild(ctx context.Context, schema pg.Schema, scope, source, key, principal string, guard *pg.GenerationJobGuard) (pg.GenerationResult, error)