Skip to content

feat(cache): add debug cache diagnostics - #145

Open
n30nex wants to merge 1 commit into
MeshCore-Beacon:devfrom
n30nex:codex/beacon-cache-diagnostics
Open

n30nex wants to merge 1 commit into
MeshCore-Beacon:devfrom
n30nex:codex/beacon-cache-diagnostics

Conversation

@n30nex

@n30nex n30nex commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

What this PR does

Add debug records for cache hits, misses, invalid entries and Redis read-error bypasses. Each record identifies the cache component without including a cache key, value or raw Redis error. Fetch and fallback behavior stays unchanged, and info-level operation remains quiet.

Related to #51. This is independent of logging-controls PR #144: it uses the standard slog default logger and becomes visible when a debug handler is configured.

Type of change

  • New feature
  • Tests

Checklist

  • go build ./... passes
  • gofmt -l . is empty
  • go vet ./... passes
  • go test ./... passes
  • New behavior has tests
  • No DB, API or dependency changes
  • I have read CONTRIBUTING.md

Testing notes

Native Pi 5 build, vet and full tests pass with PostgreSQL tests enabled. The cache suite and focused Windows race check pass. A miniredis regression verifies miss/hit/corrupt-entry records, fetch/result behavior, absence of synthetic private keys/values and silence at info level.

CI and CodeQL pass. The combined Pi preview includes this change with #144; JSON/info operation is quiet for cache diagnostics, both feeds advance and public API/WebSocket checks pass. Debug behavior is verified by the native cache tests.

AI-assisted implementation and testing under the contributor's standing authorization; submitted for maintainer review.

@n30nex

n30nex commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

@MrAlders0n please review this change with your Claude agent as part of the September 13 Beacon review batch. The current candidate is 85f861ccf0cb; validation and Pi evidence are in the PR description.

Please check cache hit/miss/error diagnostics without private keys/values or behavior changes. Issue #51 requires both #144 and this PR. Preferred sequence: merge this cache slice first, then complete the logging controls in #144 and add the closing reference there. The issue remains open while either required part is missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant