(totally vibed!) 基本完成 xidio 信息收集功能 (mostly Windows only)#7
Conversation
…d models - Added methods to NoopPlatformNetworkDiagnosticsProvider for retrieving operating system info, interface platform info, DHCP info, network neighbors, and default routes. - Introduced new models: ClockDiagnosticInfo, DefaultRouteInfo, DnsProbeResult, HttpProbeResult, InterfaceDhcpInfo, InterfacePlatformInfo, NetworkAccessMethod, NetworkNeighborInfo, OperatingSystemDiagnosticInfo, PingProbeResult, PppoeDiagnosticInfo, ProbeTargetInfo, TargetProbeResult, TcpConnectProbeResult, and VisibleWirelessNetworkInfo. - Updated NetworkDiagnosticReport and UserScenarioInfo to include new diagnostic information. - Enhanced WindowsPlatformNetworkDiagnosticsProvider to implement new methods for operating system info, interface platform info, DHCP info, network neighbors, and default routes. - Improved WindowsWlanApi to retrieve additional wireless network details and visible networks. - Updated MacPlatformNetworkDiagnosticsProvider to include stubs for new methods.
There was a problem hiding this comment.
Pull request overview
This PR expands xidio’s diagnostic data model and collection pipeline, refactors platform diagnostics providers to async/cancellable APIs, and updates the CLI to collect a user scenario interactively and render a richer, progress-driven report. It also substantially updates contributor/architecture documentation to reflect the new direction.
Changes:
- Refactored
IPlatformNetworkDiagnosticsProviderto async (ValueTask) APIs withCancellationToken, and updated Windows/macOS/no-op implementations accordingly. - Expanded
NetworkDiagnosticsCollectorand report models to include OS info, clock/NTP check, default routes, neighbor info, PPPoE summary, and active probe results with progress reporting. - Overhauled the CLI flow (questionnaire + progress bar + richer report output) and refreshed project documentation (
AGENTS.md, new docs, README update).
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| xidio/xidio.Platform.Windows/WindowsWlanApi.cs | Extends WLAN P/Invoke collection to include signal/PHY/security/rates and visible SSIDs. |
| xidio/xidio.Platform.Windows/WindowsPlatformNetworkDiagnosticsProvider.cs | Implements new async platform diagnostics APIs on Windows (WMI/WLAN + elevation check). |
| xidio/xidio.Platform.macOS/MacPlatformNetworkDiagnosticsProvider.cs | Updates macOS provider to async process execution and new provider surface (mostly stubs for new APIs). |
| xidio/xidio.Core/Models/WirelessConnectionInfo.cs | Adds richer Wi‑Fi connection fields and visible network list to the core model. |
| xidio/xidio.Core/Models/VisibleWirelessNetworkInfo.cs | New model representing a visible SSID and its properties. |
| xidio/xidio.Core/Models/UserScenarioInfo.cs | New model capturing questionnaire-derived user scenario context. |
| xidio/xidio.Core/Models/TcpConnectProbeResult.cs | New model for TCP connect probe outcomes. |
| xidio/xidio.Core/Models/TargetProbeResult.cs | New model aggregating probe results for a target (DNS/ping/TCP/HTTP). |
| xidio/xidio.Core/Models/ProblemSymptom.cs | New enum describing the user-reported symptom category. |
| xidio/xidio.Core/Models/ProbeTargetInfo.cs | New model describing an active-probe target. |
| xidio/xidio.Core/Models/PrimaryInterfaceInfo.cs | Adds interface enablement, connection status, MAC, link speed, and MTU fields. |
| xidio/xidio.Core/Models/PppoeDiagnosticInfo.cs | New model summarizing PPPoE presence and routing status. |
| xidio/xidio.Core/Models/PingProbeResult.cs | New model for ICMP probe outcomes. |
| xidio/xidio.Core/Models/OperatingSystemDiagnosticInfo.cs | New model for OS + xidio version + elevation status. |
| xidio/xidio.Core/Models/NetworkNeighborInfo.cs | New model representing ARP/neighbor table entries. |
| xidio/xidio.Core/Models/NetworkDiagnosticStage.cs | New enum for progress stages of collection/probing. |
| xidio/xidio.Core/Models/NetworkDiagnosticReport.cs | Expands report shape to include OS, clock, scenario, routes, PPPoE, and probes. |
| xidio/xidio.Core/Models/NetworkDiagnosticProgress.cs | New progress payload model for UI progress bars. |
| xidio/xidio.Core/Models/NetworkAccessMethod.cs | New enum for access method (Wi‑Fi/Ethernet/PPPoE). |
| xidio/xidio.Core/Models/InterfacePlatformInfo.cs | New model for per-interface platform fields (enabled/MTU). |
| xidio/xidio.Core/Models/InterfaceNetworkDetails.cs | Extends network details to include DHCP lease info and neighbor table. |
| xidio/xidio.Core/Models/InterfaceDhcpInfo.cs | New model for DHCP enablement and lease times. |
| xidio/xidio.Core/Models/ImpactScope.cs | New enum capturing the scope of impact reported by the user. |
| xidio/xidio.Core/Models/HttpProbeResult.cs | New model for HTTP(S) probe outcomes. |
| xidio/xidio.Core/Models/DnsProbeResult.cs | New model for DNS probe outcomes (system + direct). |
| xidio/xidio.Core/Models/DefaultRouteInfo.cs | New model representing default routes and metrics. |
| xidio/xidio.Core/Models/ConnectionMethod.cs | New enum for how the user connects to campus network (direct/router/other). |
| xidio/xidio.Core/Models/ClockDiagnosticInfo.cs | New model for local vs NTP time and offset/error. |
| xidio/xidio.Core/Diagnostics/NoopPlatformNetworkDiagnosticsProvider.cs | Updates no-op provider to satisfy new async provider interface. |
| xidio/xidio.Core/Diagnostics/NetworkDiagnosticsCollector.cs | Major refactor: async/cancellable collection, progress reporting, new probes, expanded report. |
| xidio/xidio.Core/Abstractions/IPlatformNetworkDiagnosticsProvider.cs | Refactors provider interface to async + adds new capabilities (routes, neighbors, OS info, etc.). |
| xidio/xidio.CLI/Program.cs | Makes CLI async, adds Ctrl+C cancellation, questionnaire, progress UI, and exit handling. |
| xidio/xidio.CLI/ConsoleDiagnosticReporter.cs | Renders expanded report sections (OS/clock/scenario/routes/interfaces/PPPoE/probes). |
| xidio/xidio.CLI/ConsoleDiagnosticQuestionnaire.cs | New interactive questionnaire to collect user scenario info. |
| README.md | Replaces old roadmap with concise project introduction and pointers to new docs. |
| docs/core_development_guideline.md | New core development rules (no UI deps, structured outputs, async + progress + cancellation). |
| docs/architecture.md | New architecture document describing modules, platform capabilities, and diagnostic/repair modes. |
| AGENTS.md | Rewritten agent/contributor instructions and diagnostic flow guidance. |
Comments suppressed due to low confidence (1)
xidio/xidio.Core/Diagnostics/NetworkDiagnosticsCollector.cs:546
- These per-interface progress reports set
completedStepsto 3 even though the overall collection is already past step 6. This can also cause the progress UI to move backwards. Consider keepingCompletedStepsaligned with the global stage (e.g., 6 for primary interface collection) and only vary theMessage, or extend the progress model to support nested/sub-steps.
ReportProgress(
progress,
NetworkDiagnosticStage.WirelessInfo,
$"正在读取无线连接信息:{networkInterface.Name}",
3);
wirelessInfo = await SafeGetAsync(
ct => _platformDiagnostics.GetWirelessConnectionInfoAsync(networkInterface, ct),
null,
cancellationToken);
}
if (isUp)
{
ReportProgress(
progress,
NetworkDiagnosticStage.NetworkDetails,
$"正在读取网络配置:{networkInterface.Name}",
3);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| foreach (var target in ProbeTargets) | ||
| { | ||
| cancellationToken.ThrowIfCancellationRequested(); | ||
| ReportProgress(progress, NetworkDiagnosticStage.ActiveProbes, $"正在探测:{target.Name}", 8); |
There was a problem hiding this comment.
@copilot Well I don't exactly get your ideas, can you explain further
There was a problem hiding this comment.
意思是进度条的“已完成步数”应该一直递增,不能回退。
现在流程是:SystemProxy 先报到 8,然后在每个探测目标里又用 ActiveProbes 报 8,最后探测结束再报 9。这样 UI 会出现 8 -> 9 -> 8 -> 9 或停在 8 再跳 9 的回退/抖动感。
更稳的做法是把主动探测阶段固定在 9(或保持不低于前一次值),如果想显示子进度,就在消息里带“第 N/M 个目标”,但 CompletedSteps 不要从 9 降回 8。
|
|
||
| var seconds = BinaryPrimitives.ReadUInt32BigEndian(response.Buffer.AsSpan(40, 4)); | ||
| var fraction = BinaryPrimitives.ReadUInt32BigEndian(response.Buffer.AsSpan(44, 4)); | ||
| var milliseconds = seconds * 1000d + fraction * 1000d / uint.MaxValue; |
| return ValueTask.FromResult<OperatingSystemDiagnosticInfo?>(new OperatingSystemDiagnosticInfo | ||
| { | ||
| Family = "Windows", | ||
| Description = RuntimeInformation.OSDescription, | ||
| Version = Environment.OSVersion.VersionString, | ||
| Architecture = RuntimeInformation.ProcessArchitecture.ToString(), | ||
| XidioVersion = "0.1.0", | ||
| IsElevated = IsWindowsAdministrator() | ||
| }); |
There was a problem hiding this comment.
这个版本号打算用 GitVersioning 搞了,合并完再说
| .AddChoiceGroup("综合楼", "旧综合楼", "新综合楼") | ||
| .AddChoiceGroup("其他", "公路或街道", "北校区", "其他") | ||
| ); | ||
| AnsiConsole.MarkupLine("[purple]Welcome to xidio.CLI v0.1.0, Xidian Internet Diagnostic Intelligence Operator.[/]"); |
| private static void WaitForExitKey() | ||
| { | ||
| Console.WriteLine(); | ||
| AnsiConsole.MarkupLine("[grey]按任意键退出。[/]"); | ||
| Console.ReadKey(intercept: true); | ||
| } |
There was a problem hiding this comment.
We'll fix this in later versions.
Copilot 说的是对的 Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
已请求曦格宝宝审阅,曦格宝宝说没问题,准备 merge |
该 PR 大部分由 GPT-5.5 xhigh 完成。先前零音说绝不会使用 vibe coding,不过再不用零音的额度就要重置了,不用白不用。什么沉没成本之类的,不在意了!誓死效忠 GPT!
This pull request introduces major improvements to xidio's documentation and CLI user experience, as well as significant architectural refactoring to enhance cross-platform support and future extensibility. The changes clarify project structure and development guidelines, provide detailed documentation for contributors, and overhaul the CLI to collect richer user scenario data and support asynchronous, cancellable diagnostics with progress reporting.
Key changes include:
Documentation and Contributor Guidance
AGENTS.mdto provide comprehensive contributor instructions, including detailed requirements for diagnostics, data collection, analysis flows for common network issues, and best practices for extending the project. This replaces the earlier, more limited project description.docs/architecture.mdto document the overall architecture, module responsibilities, platform-specific capabilities, and the design of diagnostic/repair/reporting flows with clear separation of privilege levels and rollback requirements.docs/core_development_guideline.mdto establish strict development rules forxidio.Core, enforcing separation from UI dependencies, structured data output, asynchronous operations, and support for progress/cancellation.README.mdto remove the old roadmap and replace it with a concise project introduction, pointing contributors to the new documentation for details.CLI User Experience and Diagnostics
ConsoleDiagnosticQuestionnaireto the CLI, providing an interactive, context-aware questionnaire that collects detailed user scenario information (location, connection method, problem type, and impact scope) before running diagnostics.Program.csto:Architectural Refactoring for Extensibility
IPlatformNetworkDiagnosticsProviderinterface to make all methods asynchronous (ValueTask), add support for cancellation tokens, and clarify method responsibilities. This lays the groundwork for robust cross-platform support and future extensibility.Minor UI and Cosmetic Changes
README.mdlogo section for improved appearance.These changes provide a solid foundation for future development by improving contributor onboarding, ensuring robust cross-platform architecture, and greatly enhancing the end-user experience in the CLI.