Improve discovery presence diagnostics - #47
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approved
The changes appear functionally coherent and tested, with only minor formatting issues called out in review comments.
Pull request overview
This PR improves LinkPulse’s “discovery presence” diagnostics and runtime observability, primarily by filtering inactive discovery entries out of the visible network map and adding richer, more structured logging across the tray, CLI, and Windows platform adapters. It also refines version/build metadata reporting (git description vs. release tag) and adds build-time artifact reporting to support diagnostics.
Changes:
- Filter inactive discovery neighbors before publishing map data, and log discovery poll/event details in the tray runtime.
- Expand logging/diagnostics: timestamped core logger output, tray/update/discovery lifecycle logs, and config load/save diagnostics.
- Improve build/version metadata:
--versionshows git description for local builds, add release-build mode, and emit an artifact report during builds.
File summaries
| File | Description |
|---|---|
| tests/test_sampler.c | Adds scenario documentation comments for sampler tests. |
| tests/test_format.c | Adds documentation comment for formatting test helpers. |
| tests/test_discovery.c | Adds documentation comments describing discovery test intent. |
| tests/test_core.c | Extends logging tests (including file sink) and adds clarifying comments. |
| tests/test_config.c | Adds clarifying comments for config contract tests. |
| tests/test_clock.c | Adds a clarifying comment for the Windows clock test. |
| src/ui/tray_win32.c | Adds sampler/update/discovery diagnostics; filters inactive neighbors from published map state. |
| src/ui/network_map_win32.h | Adds API comments for map creation/show calls. |
| src/ui/network_map_win32.c | Adds internal documentation comments for map rendering helpers. |
| src/platform/win32/update_win32.c | Adds documentation comments and logs for update parsing/flows. |
| src/platform/win32/shortcut_win32.c | Adds documentation comment and log for toast shortcut registration. |
| src/platform/win32/notification_win32.c | Adds documentation comments around toast/WinRT glue and fallbacks. |
| src/platform/win32/net_win32.c | Adds documentation comments for snapshot/default-route functions. |
| src/platform/win32/log_win32.c | Adds documentation comments for starting/stopping per-user log file. |
| src/platform/win32/discovery_win32.c | Adds documentation comments describing neighbor filtering/enrichment steps. |
| src/platform/win32/config_win32.c | Adds debug logs for config load/save and includes core logger header. |
| src/platform/win32/clock_win32.c | Adds documentation comment for overflow-safe tick conversion. |
| src/platform/win32/autostart_win32.c | Adds documentation comments for autostart registry handling. |
| src/platform/win32/activation_win32.c | Adds documentation comments for COM activation plumbing. |
| src/core/status.c | Adds documentation comment for status-to-string mapping. |
| src/core/sampler.c | Adds documentation comments for sampler responsibilities and helpers. |
| src/core/net.c | Adds documentation comments for list free/find helpers. |
| src/core/log.c | Adds full timestamp formatting, log flushing, and minor API hardening for level setting. |
| src/core/format.c | Adds documentation comment for rate formatting behavior. |
| src/core/discovery.c | Adds documentation comments for baseline and reconciliation behavior. |
| src/core/config.c | Adds documentation comments for defaults/parse/serialize helpers. |
| src/cli/tray_main.c | Adds CLI logging arg parsing and additional tray entry logging (plus formatting fixes requested). |
| src/cli/main.c | Adds --verbosity, emits richer mode start diagnostics, and uses git description for --version (plus formatting fixes requested). |
| README.md | Documents git description vs. release version behavior. |
| packaging/build-installer.ps1 | Enables release-build mode for installer builds and optionally wires clang-format. |
| include/linkpulse/update.h | Adds API comment for installer download function. |
| include/linkpulse/status.h | Adds API comment for status string helper. |
| include/linkpulse/shortcut.h | Adds API comment for toast shortcut registration. |
| include/linkpulse/platform_log.h | Adds API comments for platform log lifecycle. |
| include/linkpulse/notification.h | Adds API comments for app ID and toast helpers. |
| include/linkpulse/net.h | Adds API comments for snapshot free/find helpers. |
| include/linkpulse/log.h | Adds API comments for log level/get/file sink. |
| include/linkpulse/discovery.h | Adds API comments for init/sources/poll and platform snapshot functions. |
| include/linkpulse/config.h | Adds API comment for defaults initializer. |
| include/linkpulse/activation.h | Adds API comment for COM activator entrypoint. |
| docs/architecture.md | Adds architecture documentation for module boundaries and runtime flows. |
| CMakeLists.txt | Adds release-build option, derives git description, and adds an artifact-report custom target. |
| cmake/report_artifacts.cmake | New script to print artifact paths/sizes/sections and version metadata. |
| .vscode/launch.json | Changes VS Code debug configs to stop at entry. |
| .github/workflows/release.yml | Ensures release workflow configures LINKPULSE_RELEASE_BUILD=ON. |
Review details
Suppressed comments (1)
src/cli/tray_main.c:127
- This LP_INFO block has an extra indentation level compared to the surrounding statements (it’s aligned as if it were inside another scope). That inconsistency makes later edits error-prone.
LP_INFO("starting tray: selection=%d iface=%s virtual=%s bits=%s interval_ms=%u",
sampler_config.mode,
sampler_config.iface_name[0] != '\0' ? sampler_config.iface_name : "(default)",
sampler_config.include_virtual ? "yes" : "no", config.use_bits ? "yes" : "no",
config.interval_ms);
- Files reviewed: 45/45 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
The branch also contains the prior workspace, version metadata, logging, and CLI verbosity improvements.