Share reporter detail rendering
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# Consolidated audit catalog
|
# Consolidated audit catalog
|
||||||
|
|
||||||
Status: **19 distinct open findings: 19 P3**, consolidated from 30
|
Status: **18 distinct open findings: 18 P3**, consolidated from 30
|
||||||
numbered entries in seven audit documents. Reviewed audit state:
|
numbered entries in seven audit documents. Reviewed audit state:
|
||||||
`db732e3a1de55c844f77870e1c6db683c2685d5d`.
|
`db732e3a1de55c844f77870e1c6db683c2685d5d`.
|
||||||
|
|
||||||
@@ -390,6 +390,10 @@ are selected.
|
|||||||
|
|
||||||
## F20 — P3: Reporter message paths duplicate detail-rendering bookkeeping
|
## F20 — P3: Reporter message paths duplicate detail-rendering bookkeeping
|
||||||
|
|
||||||
|
**Complete.** Both message paths share detail callback and error bookkeeping;
|
||||||
|
focused reporter tests cover visibility, ordering, closed handles, and joined
|
||||||
|
render/write evidence.
|
||||||
|
|
||||||
Terminal and ordinary message paths repeat callback invocation, managed-writer
|
Terminal and ordinary message paths repeat callback invocation, managed-writer
|
||||||
setup, render-versus-write error classification, and first-error retention.
|
setup, render-versus-write error classification, and first-error retention.
|
||||||
Maintaining the same presentation policy in two branches increases the chance of
|
Maintaining the same presentation policy in two branches increases the chance of
|
||||||
@@ -406,7 +410,7 @@ fix deferred-message loss or writer retention. After correctness repairs, favor
|
|||||||
F20, then F18 and F17, while keeping F19 modest. All four use private functions
|
F20, then F18 and F17, while keeping F19 modest. All four use private functions
|
||||||
and existing types, with no intended public API or CLI behavior change. The
|
and existing types, with no intended public API or CLI behavior change. The
|
||||||
[F17–F20 analysis](remediation-analysis.md#f17f20--proportionate-private-extractions)
|
[F17–F20 analysis](remediation-analysis.md#f17f20--proportionate-private-extractions)
|
||||||
records the accepted scope; implementation remains pending.
|
records the accepted scope.
|
||||||
|
|
||||||
**Original:** [03-complexity M7](03-complexity.md#m7--p3-terminal-and-ordinary-messages-duplicate-detail-rendering-mechanics).
|
**Original:** [03-complexity M7](03-complexity.md#m7--p3-terminal-and-ordinary-messages-duplicate-detail-rendering-mechanics).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Audit remediation implementation plan
|
# Audit remediation implementation plan
|
||||||
|
|
||||||
Status: in progress; Stages 1–7 complete.
|
Status: in progress; Stages 1–8 complete.
|
||||||
|
|
||||||
Baseline: `d492c7747175c01a53261206c2b4356e53453621`. Before this sprint,
|
Baseline: `d492c7747175c01a53261206c2b4356e53453621`. Before this sprint,
|
||||||
intervening changes recorded decisions and retired the completed older
|
intervening changes recorded decisions and retired the completed older
|
||||||
@@ -304,6 +304,10 @@ without promising immediate garbage collection or taking ownership of closers.
|
|||||||
|
|
||||||
## Stage 8 — Share reporter detail-rendering bookkeeping
|
## Stage 8 — Share reporter detail-rendering bookkeeping
|
||||||
|
|
||||||
|
**Complete.** Terminal and ordinary reporting share detail-rendering and error
|
||||||
|
classification under the existing lock. Focused reporter and hidden-deferred
|
||||||
|
tests passed in the offline aligned Go 1.27.0 workspace with `-mod=readonly`.
|
||||||
|
|
||||||
Findings: F20. Source: `reporter.go`; follows lifecycle fixes in stages 3 and 7.
|
Findings: F20. Source: `reporter.go`; follows lifecycle fixes in stages 3 and 7.
|
||||||
|
|
||||||
1. Extract a private helper running under the existing reporting lock to invoke
|
1. Extract a private helper running under the existing reporting lock to invoke
|
||||||
|
|||||||
29
reporter.go
29
reporter.go
@@ -405,21 +405,7 @@ func renderTerminalLocked(state *reportingState, explanation Explanation) error
|
|||||||
writeErr = writer.writeError
|
writeErr = writer.writeError
|
||||||
}
|
}
|
||||||
if writeErr == nil {
|
if writeErr == nil {
|
||||||
for _, detail := range explanation.Details {
|
renderErr, writeErr = renderDetailsLocked(state, explanation.Details, true)
|
||||||
if detail == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
writer := &coordinatedWriter{state: state, destination: destinationDiagnostics}
|
|
||||||
detailErr := detail(writer)
|
|
||||||
detailWriteErr := writer.writeError
|
|
||||||
detailRenderErr := recordRendererErrorLocked(state, destinationDiagnostics, detailErr, detailWriteErr)
|
|
||||||
if renderErr == nil {
|
|
||||||
renderErr = detailRenderErr
|
|
||||||
}
|
|
||||||
if writeErr == nil {
|
|
||||||
writeErr = detailWriteErr
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if renderErr == nil && writeErr == nil {
|
if renderErr == nil && writeErr == nil {
|
||||||
destination.delivered = true
|
destination.delivered = true
|
||||||
@@ -469,6 +455,14 @@ func (state *reportingState) submitMessageLocked(category messageCategory, messa
|
|||||||
if visible && writeErr != nil {
|
if visible && writeErr != nil {
|
||||||
return writeErr
|
return writeErr
|
||||||
}
|
}
|
||||||
|
renderErr, writeErr = renderDetailsLocked(state, details, visible)
|
||||||
|
if visible && renderErr == nil && writeErr == nil {
|
||||||
|
destination.delivered = true
|
||||||
|
}
|
||||||
|
return combineOperationErrors(renderErr, writeErr)
|
||||||
|
}
|
||||||
|
|
||||||
|
func renderDetailsLocked(state *reportingState, details []Detail, visible bool) (renderErr, writeErr error) {
|
||||||
for _, detail := range details {
|
for _, detail := range details {
|
||||||
if detail == nil {
|
if detail == nil {
|
||||||
continue
|
continue
|
||||||
@@ -489,10 +483,7 @@ func (state *reportingState) submitMessageLocked(category messageCategory, messa
|
|||||||
writeErr = detailWriteErr
|
writeErr = detailWriteErr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if visible && renderErr == nil && writeErr == nil {
|
return renderErr, writeErr
|
||||||
destination.delivered = true
|
|
||||||
}
|
|
||||||
return combineOperationErrors(renderErr, writeErr)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (state *reportingState) visible(category messageCategory) bool {
|
func (state *reportingState) visible(category messageCategory) bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user