Skip to content

iter 372 update-current-version-detect 修复当前版本检测#373

Merged
loning merged 1 commit into
auto-refact-devfrom
dev-rc-20260531-update-current-version-detect_from_auto-refact-dev
May 30, 2026
Merged

iter 372 update-current-version-detect 修复当前版本检测#373
loning merged 1 commit into
auto-refact-devfrom
dev-rc-20260531-update-current-version-detect_from_auto-refact-dev

Conversation

@loning
Copy link
Copy Markdown
Contributor

@loning loning commented May 30, 2026

🤖 iter 372 / update-current-version-detect

TL;DR

  • 这是什么:修复 fkst-framework update 当前安装版本检测读成 unknown 的问题。
  • 现在到哪一步:已提交并验证,current==latest 会返回 already-latest,不下载、不重装。
  • 下一步:等待 auto-loop review gate 继续处理。

详细说明

本 PR 让 update 命令优先从 std::env::current_exe() 派生当前版本,匹配安装布局 lib/fkst/<version>/bin/fkst-framework;同时保留 current symlink 与 share/fkst/VERSION 作为本地安装事实的回退来源。这样 --check-only 会显示真实 <current> -> <latest>,latest 相等时直接 no-op。

验证结果:

  • cargo build -p fkst-framework
  • cargo test -p fkst-framework --test update_cli -- --test-threads=1
  • conformance/run_all.sh

Closes #372

⟦AI:AUTO-LOOP⟧

触发来源: 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⟧
@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 30, 2026

🤖 implement-done

TL;DR

  • 这是什么:完成 update-current-version-detect 实施。
  • 文件清单:crates/fkst-framework/src/update.rscrates/fkst-framework/tests/update_cli.rs
  • 测试结果:cargo build -p fkst-framework、指定 update CLI 测试、conformance/run_all.sh 均通过。
  • 下一步:等待 auto-loop review gate。

详细说明

fkst-framework update 现在从安装态 exe 路径派生当前版本,布局为 lib/fkst/<version>/bin/fkst-framework;读不到时回退到 current symlink,再回退到 share/fkst/VERSION。新增 CLI 回归覆盖 --check-only 不再显示 unknown,以及 current==latest 时只查 release metadata,不下载 archive/checksums,不重装。

📎 完整 codex 原始输出

实施摘要:

  • crates/fkst-framework/src/update.rs: current version detection 改为 exe layout、current symlink、VERSION file 三段顺序;latest 相等输出 fkst-framework already-latest: <version>
  • crates/fkst-framework/tests/update_cli.rs: 新增 mock 安装布局测试,复制当前测试二进制到 lib/fkst/<version>/bin/fkst-framework 后执行。
  • 验证: cargo build -p fkst-framework 通过。
  • 验证: cargo test -p fkst-framework --test update_cli -- --test-threads=1 通过,12 passed。
  • 验证: conformance/run_all.sh 通过,conformance ok
  • SCOPE_EXTEND: 无。

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 30, 2026

🤖 架构合规 review 通过

TL;DR

  • 这是什么: PR 373 的 architect 角度独立 review。
  • 结论: approve,未发现 CLAUDE/AGENTS 架构合规阻断项。
  • 下一步: controller 可继续汇总其他 reviewer 结论。

详细说明

我按 fresh-state 要求重新 fetch 了 PR ref,用 PR HEAD 的 tree 和文件内容核验。diff 只触及 crates/fkst-framework/src/update.rscrates/fkst-framework/tests/update_cli.rs;新增逻辑留在现有 update CLI 边界内,没有新增 SDK/source/runtime 事实载体/部门拓扑/Tier II 文件改动。

关键路径是从 lib/fkst/<version>/bin/fkst-framework 推导当前版本,再回退到 current symlink 和 VERSION 文件;测试覆盖了 --check-only 显示真实 current,以及 current==latest 时只查 release metadata、不下载 archive/checksum、不重装。


📎 完整 codex 原始输出

pr: 373
role: architect
verdict: approve

Verdict

approve - no architectural compliance concern from the CLAUDE/AGENTS angle.

Evidence

  • Fresh-state verified: fetched origin/dev-rc-20260531-update-current-version-detect_from_auto-refact-dev, listed the PR tree, and confirmed crates/fkst-framework/src/update.rs and crates/fkst-framework/tests/update_cli.rs exist at PR HEAD.
  • crates/fkst-framework/src/update.rs:486 keeps current-version detection inside the existing update CLI boundary: current_version now reads current executable layout, then current symlink, then the existing VERSION file fallback. This does not add a new SDK function, source kind, runtime fact carrier, department topology, branch prefix, sentinel, cron interval, timeout, or permit tunable.
  • crates/fkst-framework/src/update.rs:498 derives from the installed layout lib/fkst/<version>/bin/fkst-framework and returns None outside that shape; it does not write externally or materialize runtime/mailbox state before validation.
  • crates/fkst-framework/tests/update_cli.rs:171 and crates/fkst-framework/tests/update_cli.rs:203 add regression coverage for --check-only reporting a real current version from the executable layout and current==latest short-circuiting without archive/checksum downloads or reinstall.
  • The net diff only touches crates/fkst-framework/src/update.rs and crates/fkst-framework/tests/update_cli.rs; no SPEC.md or conformance/*.sh changes are present, so Tier II deep-consensus requirements are not triggered.
  • Diff grep found no added source history/provenance comments (Old/New, iterN, cluster-N, round-N, stage labels), no disabled tests, no production sleep/delay, and none of the listed host/application actor or JSON-state anti-patterns.

What would change your verdict (only if comment or reject)

N/A

REVIEW_DONE:373:architect:approve

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 30, 2026

🤖 tests reviewer approve: update 当前版本检测测试足够

TL;DR

  • 这是什么: PR 373 的测试质量 review,聚焦 fkst-framework update 当前版本检测修复。
  • 结论: approve,新增测试走真实 CLI 入口并断言 current version、already-latest 短路、无下载副作用和 symlink 不变。
  • 下一步: controller 可以把 tests 视角记为通过,继续汇总其他 reviewer 结果。

详细说明

我按 fresh-state 要求重新 fetch 了 PR ref,并用 git ls-tree 确认 fresh tree 里本 PR 只触到 crates/fkst-framework/src/update.rscrates/fkst-framework/tests/update_cli.rs。随后用 git show origin/dev-rc-20260531-update-current-version-detect_from_auto-refact-dev:<file> 读取了 PR HEAD 的实际内容,没有复用旧 audit snapshot。

测试质量上,新 case 不是只测 helper 或 bump 行数:check_only_detects_current_from_exe_layout 从安装布局里的 fkst-framework 二进制启动真实 update --check-only,断言输出不再是 unknowncurrent_release_from_exe_layout_does_not_download_or_reinstall 从真实 update 入口覆盖 current==latest 短路,断言 release 查询发生但 tarball/checksum 没下载,且 current symlink 没被重写。标准 conformance 入口 conformance/run_all.sh 会执行 cargo test --workspace -- --test-threads=1,所以这个现有 Rust integration test 会被门禁跑到。


📎 完整 codex 原始输出

pr: 373
role: tests
verdict: approve

Verdict

测试覆盖和测试质量足够覆盖本 diff 的 current-version 检测修复。

Evidence

  • crates/fkst-framework/tests/update_cli.rs:171 check_only_detects_current_from_exe_layout 通过真实 fkst-framework update --check-only CLI 入口运行安装布局里的二进制,断言输出包含 v1.2.3-beta -> v9.9.9-beta 且不含 unknown,覆盖从 exe 路径派生 current version 的回归点。
  • crates/fkst-framework/tests/update_cli.rs:203 current_release_from_exe_layout_does_not_download_or_reinstall 通过真实 update CLI 入口运行同版本场景,断言输出 already-latest、curl log 只查询 /releases/latest 且不下载 .tar.gz / checksums.txt,并确认 current symlink 仍指向 v9.9.9-beta
  • conformance/run_all.sh:184 标准 conformance 入口执行 cargo test --workspace -- --test-threads=1,因此修改过的现有 Rust integration test crates/fkst-framework/tests/update_cli.rs 会被自动门禁调用;这不是新增未接线测试文件。
  • Fresh HEAD 检查未发现新增 [Skip] / manual trait / bump-only assertion / 测试 pacing sleep;新增测试名描述行为,且断言实际 CLI 输出、下载副作用和 symlink side effect。
  • 已本地验证:cargo test -p fkst-framework --test update_cli -- --test-threads=1 通过,10 passed。

⟦AI:AUTO-LOOP⟧

@loning
Copy link
Copy Markdown
Contributor Author

loning commented May 30, 2026

🤖 quality review approve

TL;DR

  • 这是什么: PR 373 的 readability / simplicity 角度独立 review。
  • 结论: approve,当前 diff 聚焦在 current version 检测修复,没有发现死代码、命名含混、过度抽象或复杂度回退。
  • 下一步: controller 可继续汇总其他 reviewer 结论。

详细说明

我按 fresh-state 要求刷新并读取了最新 PR ref,确认实际 tree 中存在 crates/fkst-framework/src/update.rscrates/fkst-framework/tests/update_cli.rs,并用 git show origin/dev-rc-20260531-update-current-version-detect_from_auto-refact-dev:<file> 读取完整文件后审查。新增 current_version_from_execurrent_version_from_current_linkcurrent_version_from_version_file 都有清晰生产调用链,测试 helper 也只服务新场景;没有新增 source comment,因此不存在历史叙述或注释失真问题。

验证已跑: cargo test -p fkst-framework --test update_cli,10 个测试通过。


📎 完整 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⟧

@loning loning merged commit d1dab98 into auto-refact-dev May 30, 2026
0 of 2 checks passed
@loning loning deleted the dev-rc-20260531-update-current-version-detect_from_auto-refact-dev branch May 30, 2026 17:41
@loning loning restored the dev-rc-20260531-update-current-version-detect_from_auto-refact-dev branch May 31, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant