fix(anolisa): check target architecture - #2533
Conversation
There was a problem hiding this comment.
- 新增 target 矩阵与 CLI 行为整体一致,解决架构可用性误报问题。
- 发现 1 个 P1 与 2 个 P2 级别问题,建议按评论逐项处理。
- 建议在未来架构扩展与 OS/arch 区分场景下增强可用性提示与测试约束。
🤖 Generated by Qoder • View workflow run
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d86ae72889
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
kongche-jbw
left a comment
There was a problem hiding this comment.
Review baseline: 42b11b915f44d1a4b0a479c86447d12b4281e90f...d86ae72889aca8c7d4a32fb131b2f6ac4e9c3ef1
[P1] 为 schema v2 使用独立的索引地址
src/anolisa/crates/anolisa-cli/src/resolution.rs:20 将唯一可接受的 schema 改为 v2,
但所有版本仍读取同一个 /v1/components.toml。发布该文件后,当前已发布的 v0.2.19
会在每次 anolisa ls 时下载 v2,并因只接受 v1 而失败;先发新 CLI 也会在旧索引上
失败。因此同步发布不能保护仍在使用旧 CLI 的客户端。
Possible direction: 保留 schema v1 地址,让新 CLI 从新的版本化地址读取 v2,并补充
覆盖旧、新 reader 发布路径的回归测试。
d86ae72 to
7a6d266
Compare
|
@kongche-jbw Fixed in |
kongche-jbw
left a comment
There was a problem hiding this comment.
Review baseline: 42b11b915f44...7a6d266aa404
[P1] 让 install --all 跳过当前 target 不支持的组件
src/anolisa/crates/anolisa-cli/src/commands/tier1/install/batch.rs:864 只按 backend
过滤 v2 索引。在 Linux/aarch64 上,cosh、agent-memory 等仅支持
Linux/x86_64 的组件仍会进入批次;命令可能先安装支持项,再因这些组件没有匹配
artifact 而以 partial failure 结束。这也与 anolisa ls 对同一索引给出的
unavailable 结果冲突。
Possible direction: 再用 entry.supports_target(&env.os, &env.arch) 过滤,并补充
Linux/aarch64 和 macOS/aarch64 的批次枚举回归测试。
[P2] 在发布日志中记录 JSON 合约与索引迁移
src/anolisa/CHANGELOG.md:10 的 Unreleased 仍为空,中文 changelog 也相同。
本 PR 删除 platforms / platform_available,新增 targets /
target_available,且要求 publisher 同时部署 components-v2.toml。发布后只看
随包 changelog 的用户和镜像维护者不会看到这两个必要迁移。
Possible direction: 在中英文 Unreleased 中记录字段迁移、v1/v2 并行发布和回滚要求;
此项为发布文档,无需代码回归测试。
7a6d266 to
11142f2
Compare
|
@kongche-jbw Reviewed both findings against the latest revision.
|
kongche-jbw
left a comment
There was a problem hiding this comment.
Review baseline: 42b11b915f44d1a4b0a479c86447d12b4281e90f...11142f2c0d42ae58969ffef305babf531cfc1ee7
[P1] 让批量冲突 fixture 使用当前 target
src/anolisa/crates/anolisa-cli/src/commands/tier1/install/tests/raw_e2e.rs:1386
把两个组件的 target 固定为 Linux/x86_64,上一段代码却按
EnvService::detect() 为 distribution index 和 artifact 生成真实 target。
在 Linux/aarch64 上,新 target 过滤会得到空批次,handle_all 返回 Ok(()),
因此 cargo test -p anolisa-cli --locked 在该测试的 1561 行失败。ANOLISA CLI
明确支持 Linux/aarch64,这会让受支持平台的标准测试门禁无法通过。
Possible direction: 用 fixture 中的 env.os / env.arch 生成 v2 targets,
并在 Linux/aarch64 上覆盖该生产调用链。
Replace the OS-only component availability field with schema v2 structured OS/architecture targets. This keeps declarations unambiguous and makes human and JSON list output match the published Raw artifact matrix. Use the same exact target match when enumerating install --all. This prevents batch planning from selecting artifacts unavailable for the current host. Read v2 from components-v2.toml while keeping components.toml at schema v1. The schemas remain intentionally incompatible, but versioned addresses prevent new publications from breaking released clients. Keep the Raw batch-conflict fixture on its detected target so the production call-chain regression remains valid on every supported architecture. Fixes: f46ac79 ("feat(anolisa): show platform availability") Assisted-by: Codex:0.147.0 Signed-off-by: 爱鲲 <jiawa.syx@alibaba-inc.com>
11142f2 to
1180b30
Compare
|
@kongche-jbw Fixed in |
kongche-jbw
left a comment
There was a problem hiding this comment.
Review baseline: 42b11b915f44...1180b302fc5c
未发现阻塞问题。
Remaining risks:
components-v2.toml必须与 v1 索引并行发布;本轮未验证实际发布环境。- macOS/aarch64 仅由跨 target 测试覆盖,未在真实 macOS 主机执行。
Verification scope:
- 复查完整 diff、相邻实现和测试,以及全部评论、review threads 和 CI。
cargo test -p anolisa-cli --locked通过。cargo fmt --all -- --check与cargo clippy -p anolisa-cli --all-targets通过。- GitHub
Test anolisa、PR 检查和提交消息检查通过。
Why
anolisa lsevaluates component availability using only the host OS. Thatmisreports supported Apple Silicon artifacts for AgentSight and cosh-ng and
cannot distinguish supported and unsupported architectures on the same OS.
What changed
{ os, arch }targets.components.tomland load v2 from the independentcomponents-v2.tomladdress.platforms/platform_availablefields withtargets/
target_available, and show target-specific human-readable labels.Related issue
Closes #2526
User / Agent impact
anolisa lsnow reports availability for the exact host OS and architecture.JSON consumers of the new CLI must migrate to the v2 target fields.
Risk and compatibility
The schema is intentionally incompatible, but its publication path is isolated.
Released CLIs continue reading schema v1 from
components.toml; the new CLIreads schema v2 from
components-v2.toml. Publishers must deploy v2 alongsidev1 without replacing the existing file. The Raw repository
/v1/artifactlayout remains unchanged.
Validation
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --locked -- -D warningscargo test --workspace --lockedcargo check --workspace --lockedcargo doc --workspace --no-deps --lockedgit diff --checkValidated on Linux/x86_64, including exact Linux and macOS target-matrix cases,
JSON contract assertions, v1/future-schema rejection, distinct v1/v2 index
addresses, v2 reader selection when both generations are present,
install --allfiltering on Linux/aarch64 and macOS/aarch64, and ahost-target-aware Raw batch-conflict fixture.
Documentation and rollback
No standalone documentation changed; the wire contract is represented by the
checked-in schema v2 manifest and CLI output tests. Roll back by reverting
1180b302and stop publishingcomponents-v2.toml; schema v1 remainsuntouched.