Document standalone preflight and complete verification
This commit is contained in:
@@ -98,6 +98,11 @@ func assessSessionReadiness(runtime *invocationRuntime, report *sessionReadiness
|
||||
report.Preparation = preparationAssessment{Outcome: item.Outcome, Reason: item.Reason}
|
||||
prepared = prepareErr == nil && (item.Outcome == "completed" || item.Outcome == "reused")
|
||||
}
|
||||
if !prepared && prepareErr == nil {
|
||||
prepareErr = fmt.Errorf("preparation did not produce reusable input evidence")
|
||||
report.Preparation.Outcome = "failed"
|
||||
report.Preparation.Reason = prepareErr.Error()
|
||||
}
|
||||
if prepareErr != nil {
|
||||
report.Findings = append(report.Findings, errorFinding("preparation", prepareErr.Error()))
|
||||
}
|
||||
@@ -112,9 +117,15 @@ func assessSessionReadiness(runtime *invocationRuntime, report *sessionReadiness
|
||||
if prepared {
|
||||
report.Findings = append(report.Findings, okFinding("inputs", "prepared session inputs and audio are current"))
|
||||
if record := runtime.manifest.Stages["prepare"]; record != nil {
|
||||
if missing, ok := record.Metadata["previous_artifacts_missing_optional"]; ok {
|
||||
if hydrated := previousArtifactNames(record.Metadata["previous_artifacts_hydrated"]); len(hydrated) > 0 {
|
||||
report.Findings = append(report.Findings, okFinding("previous", fmt.Sprintf("prepared previous artifacts: %v", hydrated)))
|
||||
}
|
||||
if missing := previousArtifactNames(record.Metadata["previous_artifacts_missing_optional"]); len(missing) > 0 {
|
||||
report.Findings = append(report.Findings, infoFinding("previous", fmt.Sprintf("optional previous artifacts unavailable: %v", missing)))
|
||||
}
|
||||
if _, required := record.Metadata["previous_requirements_count"]; !required {
|
||||
report.Findings = append(report.Findings, infoFinding("previous", "no previous-session artifacts required"))
|
||||
}
|
||||
}
|
||||
}
|
||||
var failures []error
|
||||
@@ -195,3 +206,20 @@ func assessSessionReadiness(runtime *invocationRuntime, report *sessionReadiness
|
||||
}
|
||||
return errors.Join(append(failures, runtime.ctx.Err())...)
|
||||
}
|
||||
|
||||
func previousArtifactNames(value any) []string {
|
||||
switch items := value.(type) {
|
||||
case []string:
|
||||
return items
|
||||
case []any:
|
||||
var names []string
|
||||
for _, item := range items {
|
||||
if name, ok := item.(string); ok {
|
||||
names = append(names, name)
|
||||
}
|
||||
}
|
||||
return names
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user