Skip to content

ci(protocol): 默认分支 Rust checks 新失败 — clippy::result_large_err(services/core/src/remote_control.rs:336) #915

Closed

Description

@LIghtJUNction

现象

默认分支 wip/rust-core-go-extensions 的最新带 CI 提交 c576eacd(fix(extensions): enforce operations storage ownership boundary)上,protocol 作业失败:

日志(节选):

error: the `Err`-variant returned from this function is very large
   --> src/remote_control.rs:336:6
336 | ) -> Result<NativeRemote, Response> {
    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 128 bytes
    = help: ... replacing it with `Box<axum::http::Response<tonic::service::AxumBody>>`
    = note: `-D clippy::result-large-err` implied by `-D warnings`
error: could not compile `lmm-core` (lib) due to 1 previous error

原因

services/core/src/remote_control.rs 最后一次改动是 fb06f1a6(feat(core): add opt-in native relay with bounded idle streams,[skip ci]),所以 clippy 直到 c576eacd(只改了 Go 的 services/extensions)才第一次跑到它。新增的 async fn authenticate(...) -> Result<NativeRemote, Response> 的 Err 是 axum::http::Response(≥128 字节),在 -D warnings 下触发 clippy::result_large_err。

建议修复(任选其一,纯后端,无需 Opus)

  1. 把错误装箱:Result<NativeRemote, Box<Response>>,preadmit 中改为 Err(response) => return *response,各处 Err(failure(...)) 改为 Err(Box::new(failure(...)))
  2. 或在该函数上加 #[allow(clippy::result_large_err)](与 axum 中间件返回 Response 的惯例一致,改动最小)

验证:cargo clippy -p lmm-core --all-targets -- -D warnings(或 just lint)。

另一个失败步骤(此前已知,仅记录)

Native protobuf round trips and failure recovery 在 scripts/test-core-rpc-docker.py:323 断言 psql(RUNTIME_PRIVILEGES_SQL) == "t" 失败,日志有 ERROR: permission denied for schema core_charging。该步骤在 eade2dcc 上也失败过,可能是同一运行时权限问题,请 owner 一并判断。

说明

  • owner WIP 分支,本 bot 不开修复 PR(Cursor 云代理额度已耗尽),仅开 issue 记录
  • main@3948a0a1 未受影响

Activity

  1. LIghtJUNction commented on Oct 14, 2026

    @LIghtJUNction
    CollaboratorAuthor

    更新:默认分支新 tip 279f2463(bot 巡检,台北时间 2026-10-15 06:4x)

    默认分支 wip/rust-core-go-extensions 前进到 279f2463(含 183f2b0d feat(core): add MFA authority and verified model process coverage)。protocol 作业仍失败:https://github.com/TokenNotIncluded/api.lmm.best/actions/runs/38643203135/job/116123591366

    ✅ 已解决

    • 本 issue 标题里的 clippy::result_large_err(remote_control.rs):cargo clippy --locked --all-targets -- -D warnings 在该 tip 上已通过(clippy 之后的 cargo test 已开始执行)。

    ❌ 新失败(c576eacd 上因 clippy 先失败而没跑到,属本次首次暴露)

    1. Workflow and source boundaries:

      ERROR: docs/development.md: missing local target legacy-financial-opening.md
      

      183f2b0d 修改了 docs/development.md,链接到 docs/legacy-financial-opening.md,但该文件在默认分支不存在(可能还在 draft WIP(A03): offline financial opening writer, strict replay and recovery #884 A03 里)。修复:补上该文档,或先去掉链接。

    2. Rust checks and real database tests(cargo test --no-fail-fast,3 个 target 失败):

      • --lib:core_schema::index_tests::current_schema_index_predecessor_upgrade_changes_only_verified_index_and_two_receipts(src/core_schema/index_tests.rs:85)
        current-schema index-predecessor fixture must match its reviewed canonical catalog
          left: "004f567b826e6dca3c27161f68e2456703b6903e95b1845dea6f3f1064a7a3e8"
         right: "5510e0bee0e5659ff940b798c9d6d3c69aea220734d9f73577c847b6841254b7"
        
        183f2b0d 改了 schema/identity.sql / migration.sql,但 reviewed canonical catalog 哈希没同步。
      • --test cli:usage_index_owner_cli_upgrades_only_fresh_prior_fixture_and_rejects_runtime(tests/cli.rs:1063)→ Error: Storage,大概率与上面的 schema 变更同源。
      • --test model_process:新增的 6 个用例全部在 tests/model_process.rs:79 Option::unwrap() on None 失败——它们依赖 LMM_MODEL_PROCESS_ROOT / LMM_MODEL_PROCESS_CORE_SHA256(只有 scripts/verify_model_process.py 的 owned-PG runner 会设置),但被普通 cargo test --all-targets 一起跑了。建议:没有这些环境变量时 #[ignore] / 提前 return,或在 workflow 里改用该 runner。
    3. Native protobuf round trips and failure recovery:仍是 ERROR: permission denied for schema core_charging(与上文已知问题相同;183f2b0d 改过 deployment/postgres/grant-core-runtime.sql,但仍未修好)。

    说明

    • 不重开新 issue,统一在本 issue 追踪默认分支 CI;clippy 部分已修复,其余问题仍在,所以本 issue 保持打开
    • dependabot chore(deps): bump the cargo group across 1 directory with 2 updates #893(新 head f4e51371)仍是同一个 rand 0.10 API 不兼容问题,之前已分析过,不再重复评论
    • main@3948a0a1 未受影响;本 bot 不开修复 PR(Cursor 云代理额度已耗尽)
  2. LIghtJUNction commented on Oct 15, 2026

    @LIghtJUNction
    CollaboratorAuthor

    已直接推进修复,更新现有 PR #916,提交 80523172c057fb26997cbdb0cf764f319d867c7b,基于当前 WIP 906f6382ad19f213cb3aefe41915c3ab993ab7a1,未强推、未覆盖主线新增业务代码。

    本轮修改:

    • 保留 RPC 权限检查修复及 abuse 组件清单。
    • CI 的 PostgreSQL 从 17 改为与现有 RPC fixture 相同、摘要固定的 18 镜像。项目 catalog 查询包含 pg_constraint,而 PostgreSQL 18 才把表的 NOT NULL 约束记录在这里;跨大版本的结构校验值不能直接互用。没有修改任何已审核指纹来让检查通过。
    • 在完整 Rust 测试前编译程序,明确设置真实 Core 路径、SHA-256 和私有短路径目录。保留全部 6 项 model_process 用例,不加 skip 或成功兜底。
    • 修正文档中不存在的 legacy-financial-opening.md 链接,改为 A03 / WIP(A03): offline financial opening writer, strict replay and recovery #884 的进展入口,并保留资金迁移限制。

    实际自测:新增 2 项回归在旧工作流上失败,修复后 5 项相关工作流测试通过;5 个仅验证 shell 执行行为的场景通过,覆盖编译失败、缺少程序及测试失败;RPC 离线测试 13 通过、1 项原有 Docker 条件跳过。远端修改文件的 blob 与本地已测文件一致。

    历史 CI 运行 38658171431 的原生 RPC 恢复步骤实际已通过,但整个运行失败。该旧结果不能代替本次集成提交的验收。执行期间主线又更新了 schema 和审核指纹,本补丁已保留这些变化。

    当前环境没有 Rust、PostgreSQL、Docker,完整真实进程与数据库验收仍须看新提交的 CI;保持此 Issue 打开,未合并或部署。详情与验证范围已更新到 PR 正文。

  3. LIghtJUNction commented on Oct 15, 2026

    @LIghtJUNction
    CollaboratorAuthor

    更新:#916 合并后默认分支 tip 2b0ba15f 的 CI(bot 巡检,台北时间 2026-10-15 10:4x)

    #916 和 #904 合并后,默认分支 wip/rust-core-go-extensions 前进到 2b0ba15f。protocol 作业仍失败,但失败形态变了:https://github.com/TokenNotIncluded/lmm-api/actions/runs/38670886219/job/116213485248

    ✅ 本轮已通过(相对上次评论)

    • Workflow and source boundaries(legacy-financial-opening.md 链接问题已修)
    • core_schema index fixture 哈希、--test cli Storage 失败:本次日志未再出现
    • model_process 6 个用例中 5 个已通过(LMM_MODEL_PROCESS_ROOT 问题已修)

    ❌ 新失败

    1. Rust formatting(新,cargo fmt --check):

      • services/core/src/abuse/mod.rs:1:pub mod registration; 需排在 mod policy; 之后
      • services/core/src/identity/grants/protocol.rs:85:.challenge(Some("S256".into()), Some(input.code_challenge.clone().into())) 需按 rustfmt 换行
      • 修复:在 services/core 下运行 cargo fmt 即可,纯格式改动
    2. Rust checks and real database tests:只剩 --test model_process 的 independent_process_team_payer_fallback_and_revocation 失败(tests/model_process.rs:178 断言哈希不一致):

      left: "639107bba0d7dfbc3d2fcdd99c4bad67cf44843e3d056fa23a2e25b528dfcd19"
      

    right: "d53925f7ffd26867e42483174805e42b4855a71337ee33504e759eb408bd6bf9"

    其余 5 个 model_process 用例通过,可能是团队付费/撤销路径的期望值没跟上最新 schema 或 abuse 变更,需 owner 判断。
    
    3. **`Native protobuf round trips and failure recovery`**:失败点从原来的 `:323`(`permission denied for schema core_charging`)前移到 `scripts/test-core-rpc-docker.py:293` 的组件清单断言 `assert set(components) == {"identity", "ledger", "payments", "charging", "routing", ...}` → `AssertionError`。即实际注册的组件集合和 #916 写入的 12 组件清单不一致(脚本没有打印实际集合,建议断言时输出差集方便排查)。
    
    ### 说明
    - 继续在本 issue 统一追踪,不另开 issue;本 issue 保持打开
    - 本 bot 不开修复 PR(Cursor 云代理额度仍按耗尽处理,且 owner 正在推进),`main@3948a0a1` 未受影响
    
  4. LIghtJUNction commented on Oct 15, 2026

    @LIghtJUNction
    CollaboratorAuthor

    已解决,关闭(bot 巡检,台北时间 2026-10-16 00:4x)

    默认分支 wip/rust-core-go-extensions 上 Microkernel implementation checks / protocol 作业已连续 3 个提交全部通过,包括本 issue 跟踪的 Rust formatting、Rust checks and real database tests、Native protobuf round trips and failure recovery、Workflow and source boundaries 等全部步骤:

    上一次失败是 34f343e8(run 38716834585)。原始 clippy::result_large_err、文档链接、fmt、model_process 哈希等后续问题均已不再出现。如再次失败会另开新 issue。

  5. LIghtJUNction commented on Oct 15, 2026

    @LIghtJUNction
    CollaboratorAuthor

    🤖 bot 更新:默认分支 wip/rust-core-go-extensions 的 protocol job 在关闭本 issue 后再次失败,重新打开跟踪。

    • 最后一次通过:414bb144(run 38767477250)
    • 首次回归:82283fe9 feat(core): integrate bounded Pi OAuth model delegation(run 38770400453)
    • 当前 tip:1d6a9475(job 116563808931),失败步骤仍是 Rust checks and real database tests(clippy 已通过)

    失败测试:

    1. core_schema::index_tests::current_schema_index_predecessor_upgrade_changes_only_verified_index_and_two_receipts(src/core_schema/index_tests.rs:89):fixture 与 reviewed canonical catalog hash 不一致(实际 660ddf6f…,期望 431a4af6…)——与之前 ci(protocol): 默认分支 Rust checks 新失败 — clippy::result_large_err(services/core/src/remote_control.rs:336) #915 中的 index fixture hash 问题同类,可能是新迁移改变了 catalog 但没有更新 reviewed hash。
    2. identity::grants::tests::grants_restricted_runtime_permissions(src/identity/grants/tests.rs:550):Err(Storage)。
    3. tests/browser_sessions_independent.rs:77 三个测试全部失败:official complete runtime authority must pass before testing browser sessions: UnsafePrivileges(新增的 browser session 测试,CI 数据库角色权限检查不通过)。
    4. tests/cli.rs:1085 usage_index_owner_cli_upgrades_only_fresh_prior_fixture_and_rejects_runtime:Error: Storage。

    猜测(需验证):82283fe9/f2ca908c 新增的表或授权没有同步到 CI 的 runtime 角色授权与 reviewed catalog fixture。owner 正在该分支上活跃提交,bot 暂不开修复 PR(且 Cloud Agent 额度用尽)。

  6. LIghtJUNction commented on Oct 16, 2026

    @LIghtJUNction
    CollaboratorAuthor

    补充 a383369 上新出现的支付进程测试接线缺口(2026-10-16 06:39 UTC 核验,远端尚无更新;本串未见重复记录)。

    protocol 日志中,real_core_and_go_payment_credit_commit_before_local_receipt_crash 在 payments_process.rs:428:54 报「required sealed input LMM_PAYMENT_CORE_BIN」,0 passed / 1 failed。测试尚未进入 Core/Go 重启及入账恢复行为,当前日志不能用于判断该行为是否通过。

    测试入口要求 Core、Go、bootstrap 三组 LMM_PAYMENT_*_BIN / SHA256;CI Rust 步骤仅配置原有 LMM_MODEL_PROCESS 后执行全部 target,未接入支付测试专用输入。

    建议按现有 payment runner 合约冻结源码及 Core/Go/测试/bootstrap 产物,校验构建与来源回执,再经 tests/payments/verify_process.py 的新建隔离数据库路径实际运行该用例。仅补首个变量仍不足;若从普通测试入口分离,必须保留专用实跑及结果,不能把 skip 计为 pass。本条仅补充新增 CI 缺口。

  7. LIghtJUNction commented on Oct 16, 2026

    @LIghtJUNction
    CollaboratorAuthor

    bot 巡检(2026-10-16 22:40 Asia/Taipei)

    纠正此前 bot 的归因:在默认分支 tip 278ef81e 上 clippy::result_large_err 已经不存在。services/core/src/remote_control.rs 的 authenticate() 已在 183f2b0 改为返回 Result<NativeRemote, (StatusCode, &'static str)>,run 38894445203 的 cargo clippy --locked --all-targets -- -D warnings 已通过,所以没有开修复 PR。

    protocol 作业里的 exit 101 来自 cargo test,仍属本 issue:

    • tests/browser_sessions_independent.rs:77:3 个用例在 runtime_database::check 报 UnsafePrivileges
    • tests/oauth2_pi_independent.rs:257:revoked_expired_stream_retains_original_hold_until_authoritative_reconciliation 失败
    • tests/payments_process.rs:447:real_core_and_go_payment_credit_commit_before_local_receipt_crash 缺少密封输入 LMM_PAYMENT_CORE_BIN(workflow 只设置了 LMM_MODEL_PROCESS_*)

    这几项涉及计费、鉴权或 CI 接线,bot 不自动改。Native protobuf 步骤(#923)由 #925 继续跟进。

  8. LIghtJUNction commented on Oct 16, 2026

    @LIghtJUNction
    CollaboratorAuthor

    Bot note (2026-10-16 23:40 Asia/Taipei)

    clippy::result_large_err remains fixed on tip 278ef81e (prior agent bc-91b6a250).

    Current protocol cargo test failures still blocking CI (also visible on #925 head f452cdb4d / run 38921283189):

    • tests/browser_sessions_independent.rs (UnsafePrivileges / runtime_database::check)
    • tests/payments_process.rs (missing sealed input LMM_PAYMENT_CORE_BIN)
    • new: oauth2_pi_independent::revoked_expired_stream_retains_original_hold_until_authoritative_reconciliation → StaleWorker

    Launching a follow-up CloudAgent (default model) to fix these Rust integration tests on a new draft PR against wip/rust-core-go-extensions. Keep this issue open until those tests pass on the default tip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    botOpened by the maintenance bot

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions