Skip to content

[self-care:server-go-logging] Extract adxtrace candidate classification with diagnostic logging - #20199

Merged
pelikhan merged 3 commits into
mainfrom
self-care/server-go-logging-adxtrace-capture-115b806acc84cb72
Nov 4, 2026
Merged

pelikhan merged 3 commits into
mainfrom
self-care/server-go-logging-adxtrace-capture-115b806acc84cb72

Conversation

@mnkiefer

@mnkiefer mnkiefer commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Refactors server/internal/adxtrace/capture.go so per-run evidence classification lives in a testable captureCandidate function, and adds one debug summary log (cao:adxtrace) per capture pass. Behavior is unchanged.

Action: Reviewer should confirm the extraction is behavior-preserving and that go -C server vet ./... && go -C server test ./... passes.

Change

  • CaptureEvidence loop body moved into captureCandidate, which returns evidence, an exclusion reason, or an I/O error. Reason strings and placeholder evidence are identical to before.
  • One cacheLog.Printf after a completed pass logs only counts: candidates, projected, excluded. Disabled by default. No identifiers, paths, errors, or content are logged, and it is outside the per-candidate loop.

Tests

New capture_test.go uses real temp directories and real projection (no mocks) to cover projected, identity-gap, directory-gap, unavailable, invalid-source and size-exclusion outcomes, plus out-of-scope repository skipping.

Validation

gofmt clean; go -C server vet ./... and go -C server test ./... pass.

Control Plane

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

  • expires on Nov 11, 2026, 12:45 PM UTC

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mnkiefer mnkiefer self-assigned this Nov 4, 2026
@mnkiefer
mnkiefer marked this pull request as ready for review November 4, 2026 15:04
@mnkiefer
mnkiefer requested a review from pelikhan as a code owner November 4, 2026 15:04
@mnkiefer

mnkiefer commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Fix failing checks

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>

Copilot AI commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@copilot Fix failing checks

Fixed the nilerr finding in b8a1ec3 by separating projection classification from I/O error handling. golangci-lint fmt --diff, golangci-lint run ./..., go vet ./..., and go test ./... pass locally; CodeQL found no alerts.

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
@pelikhan
pelikhan merged commit 2005f61 into main Nov 4, 2026
33 checks passed
@pelikhan
pelikhan deleted the self-care/server-go-logging-adxtrace-capture-115b806acc84cb72 branch November 4, 2026 17:12
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.

3 participants