Skip to content

fix(ci): pass --output-root and wait for HTTP 200 in the core RPC check - #925

Merged
LIghtJUNction merged 3 commits into
wip/rust-core-go-extensionsfrom
cursor/fix-core-rpc-output-root-bba8
Oct 16, 2026
Merged

LIghtJUNction merged 3 commits into
wip/rust-core-go-extensionsfrom
cursor/fix-core-rpc-output-root-bba8

Conversation

@LIghtJUNction

@LIghtJUNction LIghtJUNction commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

变更说明

问题与关联 Issue/PR:

Fixes #923。默认分支 wip/rust-core-go-extensions(审查基点 278ef81e)上,core-protocol.yml 的 “Native protobuf round trips and failure recovery” 不带必填 --output-root 调用 scripts/test-core-rpc-docker.py,自 13803e61 起以退出码 2 失败。

业主对 job 116977935841(头提交 7027812c0)的诊断:

  • Rust 退出码 101 来自 cargo test。tests/browser_sessions_independent.rs 3 个失败(UnsafePrivileges,runtime_database::check),tests/payments_process.rs 1 个失败(缺少密封输入 LMM_PAYMENT_CORE_BIN)、1 个 ignored。这些属于 ci(protocol): 默认分支 Rust checks 新失败 — clippy::result_large_err(services/core/src/remote_control.rs:336) #915,本 PR 不修。
  • 补上 --output-root 之后,缺参错误已消失。Native protobuf 步骤仍以退出码 1 失败。公开日志只有两行 CHECK,然后是 FAIL: private evidence and recoverable resources retained。第三行 CHECK(reconnect / bounded database failure)没有打印。两行相隔约 1.2 秒。

为什么采用此方案:

--output-root 仍为必填。工作流仍用 realpath -m 得到绝对、无符号链接、尚不存在的路径,由脚本创建私有空 0700 目录。

退出码 1 的根因在测试套件。13803e61 把 wait() 里的 return json.loads(body) 移出了 if status == 200。扩展进程仍在、核心正在重启时,身份代理会立刻返回 JSON(services/extensions/internal/modules/identity/identity.go 的 {"error":"core_unavailable"},默认 502,Unavailable 为 503,超时为 504)。旧 wait() 会继续重试直到 200;那次改写把第一个非 200 JSON 当成就绪并返回。第三段检查是这条路径第一次出现:扩展容器不重启,只重启 core。此前的等待多数是连接失败(OSError),仍会重试,所以前两行 CHECK 能过。同一段业务断言在 eb15d7fe 的 run 38881968940 上打印过第三行 PASS(当时 wait() 只在 200 时返回)。

wait_for_http 恢复该契约:只有 HTTP 200 才记录运行中的可执行文件身份并返回 JSON;502/503/504 继续重试;连接错误仍重试;就绪观测失败(FixtureError)不当成传输错误吞掉。--output-root 与证据保留检查没有放宽。

同一次 job 的产物上传另外失败:EACCES 打开 /home/runner/work/_temp/core-rpc-docker-evidence/database-owner-url。脚本把合成凭据 chown 给容器用户 65532 并 chmod 0400,upload-artifact 读不到任意一个文件就会让整个 zip 失败。工作流只把当前用户读得到的证据复制到 core-rpc-docker-evidence-readable 再上传。容器所有的 0400 凭据仍留在原目录,不进入产物。mkdir -m 与 -p 同用会触发 shellcheck SC2174,已改为先 mkdir -p 再 chmod 0700。

复用了什么,替代或删除了什么:

保留 --output-root 接线。把嵌套 wait() 改为调用 wait_for_http。产物路径从原始证据目录改为可读副本。未改产品代码,未改 #915 的 Rust 测试。

可能破坏的行为、外部契约或数据路径:

无产品契约变化。该步骤仍会跑真实 Docker 安装检查。失败时仍保留私有证据并以退出码 1 结束。产物里不再包含读不到的合成凭据文件;运行者自己写的日志和 failure.json 仍会上传(保留 7 天)。

上游来源与许可证影响(不适用时说明):

不适用。未引入上游代码。

验证证据

审查基点 SHA:278ef81e6e87364891c80de6b03a2c8724934fe1

实际测试的 HEAD 与工作区摘要:就绪修复在 498a4f97c;shellcheck 跟进在 f452cdb4d。

修复前失败、修复后通过的命令与日志:

  • 缺 --output-root(run 38889606925 / 38891517552):退出码 2。
  • 7027812c0 的 protocol job:缺参错误已消失;第二行 CHECK 之后约 1.2 秒以退出码 1 失败;产物上传 EACCES。
  • 498a4f97c 的 run 38918404776:Native protobuf 步骤打印三行 CHECK,并以 PASS: owned Docker installation assertions and cleanup verified 结束。同一 job 的 Lint workflows 因 SC2174 退出码 1。
  • f452cdb4d 的 run 38921283189 / job 117041543206:SC2174 已消失。Native protobuf 步骤再次打印三行 CHECK,并以 PASS: owned Docker installation assertions and cleanup verified 结束(15:25:24Z)。可读证据产物上传成功(artifact 12055768542)。该 job 仍因 cargo test 退出码 101 失败:ci(protocol): 默认分支 Rust checks 新失败 — clippy::result_large_err(services/core/src/remote_control.rs:336) #915 的 browser_sessions_independent 与 payments_process,另有 oauth2_pi_independent 的 revoked_expired_stream_retains_original_hold_until_authoritative_reconciliation 以 StaleWorker 失败。这些 Rust 测试未在本 PR 修改。
  • python3 -B scripts/test_core_rpc_fixture.py -v:40 通过,1 个跳过(本机没有 Docker Compose 客户端)。
  • node --test scripts/workflow-topology.test.mjs:12 通过。本机 shellcheck 0.9.0 对证据复制脚本退出码 0。

重构的行为保持证据,或明确的业务语义差异:

无业务语义变化。就绪判定恢复为只接受 HTTP 200。

quick / related / full 的报告、失败、受阻及未执行项目:

本机没有 Docker daemon,未在本机跑完整安装脚本;上述 GitHub job 是该步骤的实际结果。改 scripts/workflow-topology.test.mjs 使每次推送都触发 Native Linux package checks:amd64 通过,arm64 在链接 lmm-cli 时因 musl 缺少 __aarch64_ldadd4_sync 失败(run 38921283529)。这与本 PR 的 RPC 套件无关,未在此修。scripts/quality-gate.py 的 rpc-docker 与文档示例仍不传 --output-root。agcc 在本环境不可用。

用户可见变化的浏览器证据;核心变化的同环境资源对比(适用时):

不适用。无界面变化。

必须独立审查的内容

门禁、测试断言、类型配置、阈值、锁文件、基线或例外的变更与理由:

无断言或门槛放宽。--output-root 仍必填。就绪仍要求 HTTP 200。失败仍保留私有证据。产物不再尝试打包读不到的凭据文件。

高风险业务、临时方案的责任人、到期时间与退出条件:

无资金或权限变更。可读证据副本可能含命令日志;合成凭据文件本身不进入产物。保留期仍为 7 天。

独立审查者与证据(尚未执行请写 pending,作者不能自行批准):

pending。

提交前核对

  • 一个明确目标,无夹带格式化、重命名或架构重写;已核对重复工作及被删除内容的消费者。
  • 没有通过跳过测试、删除有效断言、测试专用成功分支或降低门槛换取通过。
  • 模块测试、真实业务验收、未执行与受阻项目已区分;构建成功未冒充完整验收。
  • 已更新受影响的文档和配置;代码及提交证据不含凭据、DSN 或用户私密数据。
Open in Web Open in Cursor 

The protocol workflow still called test-core-rpc-docker.py without
--output-root after that flag became required. Point it at a fresh
directory under RUNNER_TEMP and keep that directory with the evidence artifact.

Fixes #923

Co-authored-by: LIghtJUNction <lightjunction.me@gmail.com>

Copy link
Copy Markdown
Collaborator Author

bot 巡检(2026-10-16 21:39 Asia/Taipei)

Copy link
Copy Markdown
Collaborator Author

补充纠正这次 CI 的诊断:job 116977935841 中,Rust exit 101 对应 cargo test 的 browser_sessions_independent(3 个失败)和 payments_process(1 个失败、1 个 ignored),不能归因于旧的 clippy/result_large_err。Native protobuf 步骤也已明确以 exit 1 失败,并非状态待确认。补上 --output-root 消除了原缺参错误,但尚未通过 Docker 验收;Native 的具体失败根因仍待查。请沿现有 PR 继续处理,保持 Draft。

A live extension proxy returns 503 JSON while core restarts. The fixture
treated that body as readiness, so the reconnect check failed immediately.
Stage only runner-readable evidence so artifact upload is not rejected by
container-owned secret files.

Co-authored-by: LIghtJUNction <lightjunction.me@gmail.com>
@cursor cursor Bot changed the title fix(ci): pass required --output-root to the core RPC docker check fix(ci): pass --output-root and wait for HTTP 200 in the core RPC check Oct 16, 2026
shellcheck SC2174 rejects mkdir -m together with -p, and actionlint
failed the protocol workflow on that warning.

Co-authored-by: LIghtJUNction <lightjunction.me@gmail.com>

Copy link
Copy Markdown
Collaborator Author

Bot follow-up (2026-10-16 23:39 Asia/Taipei)

CloudAgent bc-a2f31d40 finished and pushed f452cdb4d.

#923 scope fixed on this PR:

  • Native protobuf step now prints all three CHECK lines and ends with PASS: owned Docker installation assertions and cleanup verified (run 38921283189 / job 117041543206).
  • shellcheck SC2174 gone; readable evidence artifact upload succeeded.
  • Root cause was wait() treating first non-200 JSON (core_unavailable 502/503/504) as ready; restored HTTP-200-only readiness via wait_for_http.

Still failing (out of #923/#925 scope):

  • protocol job cargo test exit 101 — #915 family (browser_sessions_independent, payments_process) plus new oauth2_pi_independent StaleWorker.
  • arm64 package check: musl missing __aarch64_ldadd4_sync when linking lmm-cli (run 38921283529); amd64 packages OK.

Draft kept. mergeable=true, mergeable_state=unstable. Do not merge until owner reviews.

@LIghtJUNction
LIghtJUNction marked this pull request as ready for review October 16, 2026 17:13
Copilot AI balanced review requested due to automatic review settings October 16, 2026 17:13

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ⚠️ Failed 2026-10-16T17:13:18.425743Z f452cdb Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@LIghtJUNction
LIghtJUNction merged commit caebd81 into wip/rust-core-go-extensions Oct 16, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(protocol): 「Native protobuf round trips」步骤新失败 — test-core-rpc-docker.py 缺少必填 --output-root

3 participants