fix: add open progress staging and forced key evidence to display_diag (#3)

This commit is contained in:
2026-11-28 14:43:32 +01:00
parent 903c5c69b6
commit acc721e7e7
5 changed files with 496 additions and 49 deletions
+14 -1
View File
@@ -89,9 +89,10 @@ func (d *Diag) emit(kind, role string, forced bool, fields ...string) {
if d.last[key] == line {
return
}
d.last[key] = line
}
d.count++
key := kind + "|" + role
d.last[key] = line
if d.out != nil {
fmt.Fprintln(d.out, line)
}
@@ -116,6 +117,18 @@ func diagValue(text string) string {
// never bloat the journal stream.
const diagValueMaxLen = 160
// Records returns the most recent distinct record per key, for tests
// asserting what reached the writer.
func (d *Diag) Records() []string {
d.mu.Lock()
defer d.mu.Unlock()
out := make([]string, 0, len(d.last))
for _, line := range d.last {
out = append(out, line)
}
return out
}
// VCSRevision returns the VCS revision the binary was built from, or
// unknown when the build carried none. No other build or environment
// metadata is exposed.