Repository navigation
feat(process): add process.listeningPorts resolution for run sessions - #131
Merged
Merged
Conversation
1lck
marked this pull request as ready for review
November 20, 2026 09:04
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.
改动说明 / What changes
为运行窗口监听端口展示提供 Rust Core 的共享进程树与 TCP 监听端口解析能力,跨平台桌面端仅采集本机进程/套接字表,全部解析、去重、过滤和 URL 格式化下沉到 Core。
核心改动
lithe-process(rust/crates/process/src/ports.rs):PortProcess、ListeningSocket、ListeningPortsRequest、ListeningPort、ListeningPortsResponse与resolve()。rootPid(带rootStartedAtMsPID 复用校验与环防护)遍历整棵进程树,过滤非监听端口、0 端口和excludePorts(如附着的调试端口)。0.0.0.0、[::]、::)及%zone后缀、IPv4 映射 IPv6 地址(::ffff:127.0.0.1),双栈并存时按localhost > 127.0.0.1 > LAN > wildcard确定性去重,输出可点击 URL(IPv6 带方括号)与展示标签并按端口升序截断(默认 8,上限 32)。lithe-core(命令路由、高频日志豁免、共享 Fixture 与测试):protocol/command.rs与runtime/dispatcher.rs注册process.listeningPorts(CoreCommand::ProcessListeningPorts)。runtime/request_trace.rs的is_hot中豁免轮询命令process.listeningPorts并补充单测。rust/fixtures/process-lifecycle/listening-ports-v1.json与集成测试rust/crates/core/src/tests/process_ports.rs。rust/contracts/rust-core-api.md补充 API 汇总行与完整请求/响应契约文档。验证 / Verification
cargo fmt --manifest-path rust/Cargo.toml --all -- --check./scripts/rust-core/verify-rust-core-comments.sh process corenode scripts/rust-core/verify-platform-tests.mjsnode scripts/rust-core/affected-crates.mjscargo clippy --manifest-path rust/Cargo.toml -p lithe-process -p lithe-core --all-targets --all-features -- -D warningsenv -u GIT_EDITOR cargo test --manifest-path rust/Cargo.toml -p lithe-processenv -u GIT_EDITOR cargo test --manifest-path rust/Cargo.toml -p lithe-coregit diff --check环境说明与未执行项:
GIT_EDITOR=false,会干扰既有的tests::git::git_operation_state_reports_and_resolves_a_merge_conflict(与本次改动无关),测试时以env -u GIT_EDITOR排除该环境变量影响。x86_64-pc-windows-msvc/x86_64-pc-windows-gnu的coresysroot,也无可用 Windows VM,因此未在本地执行 Windows 目标 Clippy(本次process::ports为纯标准库/serde/ipnet 逻辑,无平台条件编译分支)。既有债务检查 / Dead code & Debt