Skip to content

fix(anolisa): check target architecture - #2533

Merged
ikunkun-sys merged 1 commit into
alibaba:mainfrom
ikunkun-sys:fix/anolisa/architecture-availability
Aug 14, 2026
Merged

fix(anolisa): check target architecture#2533
ikunkun-sys merged 1 commit into
alibaba:mainfrom
ikunkun-sys:fix/anolisa/architecture-availability

Conversation

@ikunkun-sys

@ikunkun-sys ikunkun-sys commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Why

anolisa ls evaluates component availability using only the host OS. That
misreports supported Apple Silicon artifacts for AgentSight and cosh-ng and
cannot distinguish supported and unsupported architectures on the same OS.

What changed

  • Add a schema v2 component index with structured { os, arch } targets.
  • Keep schema v1 at components.toml and load v2 from the independent
    components-v2.toml address.
  • Evaluate availability against the complete host target.
  • Replace the JSON platforms / platform_available fields with targets
    / target_available, and show target-specific human-readable labels.
  • Declare the currently published Raw target matrix for every component.

Related issue

Closes #2526

User / Agent impact

anolisa ls now 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

  • Public CLI, API, configuration, or documented behavior changed
  • Privileged or security-sensitive behavior changed
  • Cross-component contract changed
  • Migration or rollback guidance is needed

The schema is intentionally incompatible, but its publication path is isolated.
Released CLIs continue reading schema v1 from components.toml; the new CLI
reads schema v2 from components-v2.toml. Publishers must deploy v2 alongside
v1 without replacing the existing file. The Raw repository /v1/ artifact
layout remains unchanged.

Validation

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo test --workspace --locked
  • cargo check --workspace --locked
  • cargo doc --workspace --no-deps --locked
  • git diff --check

Validated 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 --all filtering on Linux/aarch64 and macOS/aarch64, and a
host-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
1180b302 and stop publishing components-v2.toml; schema v1 remains
untouched.

@github-actions github-actions Bot added the component:anolisa src/anolisa label Aug 14, 2026
@ikunkun-sys
ikunkun-sys marked this pull request as ready for review August 14, 2026 06:01

@qoderai qoderai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 新增 target 矩阵与 CLI 行为整体一致,解决架构可用性误报问题。
  • 发现 1 个 P1 与 2 个 P2 级别问题,建议按评论逐项处理。
  • 建议在未来架构扩展与 OS/arch 区分场景下增强可用性提示与测试约束。

🤖 Generated by QoderView workflow run

Comment thread src/anolisa/crates/anolisa-cli/src/commands/tier1/list.rs
Comment thread src/anolisa/crates/anolisa-cli/src/commands/tier1/list/render.rs
Comment thread src/anolisa/crates/anolisa-cli/src/resolution.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/anolisa/manifests/components.toml Outdated

@kongche-jbw kongche-jbw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 发布路径的回归测试。

@ikunkun-sys
ikunkun-sys force-pushed the fix/anolisa/architecture-availability branch from d86ae72 to 7a6d266 Compare August 14, 2026 06:31

Copy link
Copy Markdown
Collaborator Author

@kongche-jbw Fixed in 7a6d266a. The existing /v1/components.toml remains schema v1 and unchanged; schema v2 now lives at /v1/components-v2.toml, and the new CLI loads only that address. Regression tests cover both URLs and prove the v2 reader selects the separate file when both generations are present.

@kongche-jbw kongche-jbw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review baseline: 42b11b915f44...7a6d266aa404

[P1] 让 install --all 跳过当前 target 不支持的组件

src/anolisa/crates/anolisa-cli/src/commands/tier1/install/batch.rs:864 只按 backend
过滤 v2 索引。在 Linux/aarch64 上,coshagent-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 并行发布和回滚要求;
此项为发布文档,无需代码回归测试。

@ikunkun-sys
ikunkun-sys force-pushed the fix/anolisa/architecture-availability branch from 7a6d266 to 11142f2 Compare August 14, 2026 06:58

Copy link
Copy Markdown
Collaborator Author

@kongche-jbw Reviewed both findings against the latest revision.

  • P1 fixed in 11142f2c: install --all now requires both the selected backend and an exact current OS/architecture match. Regression coverage pins the checked-in Raw enumeration for Linux/aarch64 (cosh-ng, tokenless) and macOS/aarch64 (cosh-ng, agentsight, tokenless).
  • P2 intentionally not changed: specs/documentation-standard.md §5 mandates that daily feature/fix PRs do not update CHANGELOG files; changelogs are aggregated exclusively in release version-bump PRs. This PR's description already records the JSON field migration, parallel v1/v2 publication requirement, and rollback procedure.

@kongche-jbw kongche-jbw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@ikunkun-sys
ikunkun-sys force-pushed the fix/anolisa/architecture-availability branch from 11142f2 to 1180b30 Compare August 14, 2026 07:27

Copy link
Copy Markdown
Collaborator Author

@kongche-jbw Fixed in 1180b302. write_published_batch_conflict_repo now writes the v2 component targets from the same detected env.os / env.arch used for distribution entries and artifact paths. The install_all_dry_run_rejects_conflicts_between_planned_components regression continues exercising the real handle_all path and now remains valid on Linux/aarch64 as well as Linux/x86_64.

@kongche-jbw kongche-jbw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 -- --checkcargo clippy -p anolisa-cli --all-targets 通过。
  • GitHub Test anolisa、PR 检查和提交消息检查通过。

@ikunkun-sys
ikunkun-sys merged commit 52fa315 into alibaba:main Aug 14, 2026
24 checks passed
@ikunkun-sys
ikunkun-sys deleted the fix/anolisa/architecture-availability branch August 17, 2026 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

anolisa ls ignores architecture when reporting component availability

2 participants