-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Parent: #113
Depends on: Phase 2 (step manipulation)
Problem
After rewriting or reverting a step, downstream steps may consume stale artifacts. Users need visibility into what's stale and control over how to propagate changes.
Design
Stale artifact detection
Walk the pipeline DAG forward from a modified step. For each downstream step, check if its injected artifacts have been modified (mtime comparison against step completion time).
// Added to StepController interface
GetStaleDownstream(runID, stepID string) ([]StaleStep, error)
CascadeFrom(ctx context.Context, runID, stepID string, targets []string) error
type StaleStep struct {
StepID string
Reasons []string // Why it's stale (e.g., "consumes artifact X from modified step Y")
AffectedArtifacts []string
}Reuse existing infrastructure
StaleArtifactDetectorfromvalidation.go— already detects mtime-based stalenessResumeManager.createResumeSubpipeline()— creates subpipeline from step forwardResumeManager.executeResumedPipeline()— executes subpipeline- DAG topology from
DAGValidator.TopologicalSort()
Cascade modes
After detecting stale steps, present the user with options:
- Cascade: Re-run all stale downstream steps automatically
- Selective: Let user pick which steps to re-run (interactive prompt)
- Stop: Leave stale artifacts as-is (user acknowledges staleness)
Implementation approach
- Generalize
StaleArtifactDetectorto work with any pipeline (currently prototype-only) - Add
GetStaleDownstream()that walksinject_artifactsreferences forward - Add
CascadeFrom()that creates a subpipeline of selected targets and executes - Add stale markers to state store (tag-based:
stale:<step-id>) - Update
wave chatworkspace CLAUDE.md to include stale step warnings
Files to create/modify
| File | Action |
|---|---|
internal/pipeline/cascade.go |
Create — Cascade detection and execution |
internal/pipeline/cascade_test.go |
Create — Tests |
internal/pipeline/validation.go |
Modify — Generalize StaleArtifactDetector |
internal/pipeline/stepcontroller.go |
Modify — Add cascade methods |
internal/pipeline/chatworkspace.go |
Modify — Stale warnings in CLAUDE.md |
Acceptance criteria
-
GetStaleDownstream()correctly identifies all steps consuming artifacts from modified step -
CascadeFrom()re-runs selected steps in topological order - Stale detection works for any pipeline (not just prototype)
- Chat workspace shows stale warnings
- All tests pass with
-race
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels