Skip to content

[self-care:server-go-logging] Extract audit lifecycle classification and add scan logging - #19898

Closed
mnkiefer wants to merge 1 commit into
mainfrom
self-care/server-go-logging-auditlifecycle-96cba3a5394e444a
Closed

mnkiefer wants to merge 1 commit into
mainfrom
self-care/server-go-logging-auditlifecycle-96cba3a5394e444a

Conversation

@mnkiefer

Copy link
Copy Markdown
Contributor

Refactors server/internal/auditlifecycle.Scan so lifecycle classification and result-status derivation are separate, directly testable functions, and adds one debug log at scan completion. Behavior is unchanged.

Action: Reviewer should confirm Scan behavior is preserved and the log carries only scalar metadata; acceptance check is passing go -C server vet ./... and go -C server test ./....

Details
  • Extracted classify (per-rebuild classification and tallies) and resultStatus (ok/attention/incomplete) from Scan. Status precedence is unchanged: incomplete, then attention, then ok.
  • Added scanLog (cao:auditlifecycle) with one call at scan completion, logging only status, scanned count, finding count and tail-reached flag. Logging is off by default, and the call is outside every loop. It records no rebuild IDs, attributes, or errors.
  • Added classify_test.go with table-driven tests that call the real functions on concrete values. They cover terminal, partial-history, gap, zero-time, clock-uncertain, pending and missing-terminal classifications, and the status precedence rules. No mocks or fakes.
  • Validation: gofmt, go -C server vet ./... and go -C server test ./... all passed.

Control Plane

Generated by SelfCare / Server Go Logging · copilot · auto · ~37 AIC · ⌖ ~1 AIC · ⊞ 14.8K · ◷

  • expires on Nov 5, 2026, 2:46 PM UTC

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant