• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

umputun / ralphex / 26432776504

26 May 2026 04:45AM UTC coverage: 83.285% (-0.08%) from 83.363%
26432776504

push

github

web-flow
Refactor processor runner into phase engines (#364)

* refactor(processor): extract runner phase engines

Move task, review, external review, finalize, and plan creation behavior into phase engines with shared execution, prompt, plan location, break, and git-state services. Keep Runner focused on pipeline coordination.

* docs: document processor phase architecture

Archive the completed implementation plan and update project guidance with the phase package boundaries.

* fix(processor): guard optional runner dependencies

* fix(processor): guard external review phase holder

1114 of 1228 new or added lines in 15 files covered. (90.72%)

19 existing lines in 4 files now uncovered.

7683 of 9225 relevant lines covered (83.28%)

222.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.33
/pkg/processor/phase/break_controller.go
1
package phase
2

3
import "context"
4

5
// BreakController translates break-channel events into cancellable phase contexts.
6
type BreakController struct {
7
        deps *Deps
8
}
9

10
// NewBreakController creates a break controller backed by shared dependencies.
11
func NewBreakController(deps *Deps) *BreakController {
81✔
12
        return &BreakController{deps: deps}
81✔
13
}
81✔
14

15
func (b *BreakController) context(parent context.Context) (context.Context, context.CancelFunc) {
31✔
16
        ch := b.breakCh()
31✔
17
        if ch == nil {
55✔
18
                return parent, func() {}
48✔
19
        }
20
        ctx, cancel := context.WithCancel(parent)
7✔
21
        go func() {
14✔
22
                select {
7✔
23
                case <-ch:
5✔
24
                        cancel()
5✔
25
                case <-ctx.Done():
2✔
26
                }
27
        }()
28
        return ctx, cancel
7✔
29
}
30

31
func (b *BreakController) isBreak(loopCtx, parentCtx context.Context) bool {
21✔
32
        return loopCtx.Err() != nil && parentCtx.Err() == nil
21✔
33
}
21✔
34

35
func (b *BreakController) drain() {
8✔
36
        ch := b.breakCh()
8✔
37
        if ch == nil {
9✔
38
                return
1✔
39
        }
1✔
40
        select {
7✔
41
        case <-ch:
2✔
42
        default:
5✔
43
        }
44
}
45

46
func (b *BreakController) breakCh() <-chan struct{} {
39✔
47
        if b == nil || b.deps == nil {
39✔
NEW
48
                return nil
×
NEW
49
        }
×
50
        return b.deps.BreakCh
39✔
51
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc