Fifteen paragraphs of the form "this file used to hold a second copy of <cmd>: it parsed the flags again, opened a unit of work...". The fact that a second implementation existed explains nothing about the code that is there now, and the commit that removed it says so in more detail than a doc comment should. Reviewed individually rather than pattern-matched. A first pass keyed on phrases like "used to" and "this slice" flagged 130 paragraphs and would have taken out design rationale with them — it cut bootstrapper.go's "WHY ONLY THIS SLICE OF bd init IS A ROLE" because "THIS SLICE" matched a pattern meant for programme slices. That pass was reverted. Of the 69 paragraphs a tightened pass surfaced, these 15 are the ones carrying no live information; the other 54 explain an invariant, a trap, or a behaviour change a user sees, and stay.
28 lines
970 B
Go
28 lines
970 B
Go
package main
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
|
|
"github.com/steveyegge/beads/internal/storage/uow"
|
|
"github.com/steveyegge/beads/issueops"
|
|
)
|
|
|
|
// proxiedStatsReporter hands back the guarded summary-statistics surface for
|
|
// the proxied-server provider, through the provider's OWN capability accessor —
|
|
// the same two-step proxiedCounter performs, and for the same reason: the
|
|
// accessor is where each layer is added.
|
|
//
|
|
// The role is asked for at the TOP of the command, before any work: this
|
|
// command resolves no ids, so there is nothing to look up first and no
|
|
// lookup-only provider to trip over.
|
|
func proxiedStatsReporter() (issueops.StatsReporter, error) {
|
|
if uowProvider == nil {
|
|
return nil, errors.New("proxied-server UOW provider not initialized")
|
|
}
|
|
src, ok := uowProvider.(uow.StatsReporterSource)
|
|
if !ok {
|
|
return nil, fmt.Errorf("proxied-server provider %T does not offer the summary-statistics surface", uowProvider)
|
|
}
|
|
return src.StatsReporter()
|
|
}
|