Document and verify published product imports

This commit is contained in:
2026-12-02 16:49:46 +00:00
parent 56483f9064
commit e5d91cb19b
32 changed files with 330 additions and 265 deletions

View File

@@ -137,7 +137,7 @@ func buildInventoryRestorePlan(ctx context.Context, cfg *config.Config, current
})
plan := &RestorePlan{Actions: actions}
if err := projectInventoryCoverage(ctx, cfg, plan); err != nil {
if err := projectInventoryCoverage(ctx, cfg, plan, store); err != nil {
return nil, err
}
for _, action := range actions {
@@ -157,7 +157,7 @@ func buildInventoryRestorePlan(ctx context.Context, cfg *config.Config, current
// projectInventoryCoverage describes completion if all accepted transfers
// validate successfully. It never treats a declaration as verified content.
func projectInventoryCoverage(ctx context.Context, cfg *config.Config, plan *RestorePlan) error {
func projectInventoryCoverage(ctx context.Context, cfg *config.Config, plan *RestorePlan, store storage.ObjectStore) error {
manifestPath := artifacts.SessionManifestPathForCampaign(cfg.Pipeline.Workspace.Root, cfg.Session.Campaign, cfg.Session.SessionID)
local, _, err := loadManifestAtPathIfPresent(ctx, &manifest.LocalStore{}, manifestPath)
if err != nil {
@@ -261,12 +261,34 @@ func projectInventoryCoverage(ctx context.Context, cfg *config.Config, plan *Res
}
covered["extract"] = covered["extract"] || complete
}
if cfg.Pipeline.Render == nil || cfg.Pipeline.Render.Enabled == nil || *cfg.Pipeline.Render.Enabled {
names = append(names, "render")
}
if cfg.Pipeline.Notarius != nil && cfg.Pipeline.Notarius.Enabled {
names = append(names, "extract")
// Reuse the normal read-only stage projection for preserved local work.
// Proposed downloads have not been installed, so the supplied coverage above
// remains conditional and local validation may conservatively schedule work.
if local != nil {
model, cloneErr := cloneManifestForPlan(plan.candidate, cfg)
if cloneErr != nil {
return cloneErr
}
if err := invalidateImportedDependencies(model, plan.baseline, plan.Actions); err != nil {
return err
}
effective, effectiveErr := resolveEffectiveArtifacts(cfg, nil)
selection, selectionErr := BuildBoundedPlan("", "")
if effectiveErr == nil && selectionErr == nil {
projection, _ := projectSelectedWork(ctx, cfg, selection, false, nil, effective, artifacts.NewLocalStore(cfg.Pipeline.Workspace.Root), store, model)
if err := ctx.Err(); err != nil {
return err
}
if projection != nil {
for _, item := range projection.Stages {
if item.Decision.action == stageActionSkip && recordedStageStatus(local, item.Name) == manifest.StatusSucceeded {
covered[item.Name] = true
}
}
}
}
}
names = []string{"prepare", "transcribe", "merge", "polish", "normalize", "trim", "render", "extract", "analyze", "publish", "notify", "cleanup"}
for _, name := range names {
if covered[name] {
plan.Satisfied = append(plan.Satisfied, name)