iter 372 update-current-version-detect 修复当前版本检测#373
Conversation
触发来源: audit-iter-372 update-current-version-detect,fkst-framework update 将当前安装版本读成 unknown,导致 latest 安装也无法短路。 行为类型: 修改 crates/fkst-framework/src/update.rs 的 current version detection,并补充 crates/fkst-framework/tests/update_cli.rs CLI 回归测试。 等价语义: 对 lib/fkst/<version>/bin/fkst-framework 安装布局派生出的 current 与 release.tag 相等时,语义等价于 already-latest no-op,不下载 archive/checksums,不执行 reinstall。 后续复用: 后续 update 检查、--check-only 输出和显式 update 可复用同一 current detection 顺序,不依赖缺失时会变 unknown 的单一 VERSION 文件。 失败痕迹归属: cargo build -p fkst-framework、cargo test -p fkst-framework --test update_cli -- --test-threads=1、conformance/run_all.sh;若回归则归属 update current-version-detect socket。 ⟦AI:AUTO-LOOP⟧
🤖 implement-doneTL;DR
详细说明
📎 完整 codex 原始输出实施摘要:
⟦AI:AUTO-LOOP⟧ |
🤖 架构合规 review 通过TL;DR
详细说明我按 fresh-state 要求重新 fetch 了 PR ref,用 PR HEAD 的 tree 和文件内容核验。diff 只触及 关键路径是从 📎 完整 codex 原始输出pr: 373
|
🤖 tests reviewer approve: update 当前版本检测测试足够TL;DR
详细说明我按 fresh-state 要求重新 fetch 了 PR ref,并用 测试质量上,新 case 不是只测 helper 或 bump 行数: 📎 完整 codex 原始输出pr: 373
|
🤖 quality review approveTL;DR
详细说明我按 fresh-state 要求刷新并读取了最新 PR ref,确认实际 tree 中存在 验证已跑: 📎 完整 codex 原始输出---
pr: 373
role: quality
verdict: approve
---
## Verdict
Approve: the PR stays focused on current-version detection, keeps the implementation small, and does not introduce readability, naming, dead-code, or unnecessary-abstraction issues.
## Evidence
- `crates/fkst-framework/src/update.rs:486`: `current_version` now composes three clearly named sources in priority order, keeping the call site simple and avoiding a broad abstraction.
- `crates/fkst-framework/src/update.rs:492`: `current_version_from_exe` is reachable from production code through `current_version`, and the helper has a single narrow responsibility.
- `crates/fkst-framework/src/update.rs:498`: `current_version_from_exe_path` is short and linear; the guard names follow the install-layout domain (`bin_dir`, `version_dir`, `install_root`) without generic manager/helper naming.
- `crates/fkst-framework/src/update.rs:518`: `current_version_from_current_link` and `current_version_from_version_file` are both reachable fallbacks, so the PR does not add dead private helpers.
- `crates/fkst-framework/tests/update_cli.rs:124`: the new test fixture helper models the missing `VERSION` file case directly and is used by both new tests.
- `crates/fkst-framework/tests/update_cli.rs:171`: `check_only_detects_current_from_exe_layout` verifies `--check-only` reports the real current version instead of `unknown`.
- `crates/fkst-framework/tests/update_cli.rs:203`: `current_release_from_exe_layout_does_not_download_or_reinstall` verifies the already-latest short circuit without adding unrelated behavior coverage.
## What would change your verdict (only if comment or reject)
N/A
REVIEW_DONE:373:quality:approve⟦AI:AUTO-LOOP⟧ |
🤖 iter 372 / update-current-version-detect
TL;DR
fkst-framework update当前安装版本检测读成unknown的问题。current==latest会返回already-latest,不下载、不重装。详细说明
本 PR 让 update 命令优先从
std::env::current_exe()派生当前版本,匹配安装布局lib/fkst/<version>/bin/fkst-framework;同时保留currentsymlink 与share/fkst/VERSION作为本地安装事实的回退来源。这样--check-only会显示真实<current> -> <latest>,latest 相等时直接 no-op。验证结果:
cargo build -p fkst-frameworkcargo test -p fkst-framework --test update_cli -- --test-threads=1conformance/run_all.shCloses #372
⟦AI:AUTO-LOOP⟧