Add artifact-aware analyze resume planning

This commit is contained in:
2026-08-29 20:01:57 +00:00
parent 4e4e2b7d96
commit 3128bef20a
14 changed files with 594 additions and 58 deletions

View File

@@ -53,14 +53,35 @@ const maxResumeReasonLength = 512
type ResumeValidation struct {
Resumable bool
Reason string
Analyze *AnalyzeResumeSummary
}
// AnalyzeResumeSummary describes the artifact-level decision behind an
// aggregate analyze resume result.
type AnalyzeResumeSummary struct {
ExplicitTargets []string
PrerequisiteWork []AnalyzeResumeArtifact
ExecutionOrder []AnalyzeResumeArtifact
ReusedCurrent []AnalyzeResumeArtifact
}
// AnalyzeResumeArtifact is one deterministic artifact-level plan entry.
type AnalyzeResumeArtifact struct {
Key string
Role string
Reason string
Forced bool
}
// Normalized returns a result with a bounded reason and no reason on success.
func (r ResumeValidation) Normalized() ResumeValidation {
if r.Resumable {
return Resumable()
r.Reason = ""
return r
}
return NonResumable(r.Reason)
normalized := NonResumable(r.Reason)
normalized.Analyze = r.Analyze
return normalized
}
// ResumeValidator is implemented by stages that validate persisted success before reuse.