Skip to content

Upgrade multi-surface release preflight, DSH npmjs discovery, and release pipeline - #9244

Merged
loopx-agent merged 2 commits into
mainfrom
codex/release-multi-surface-workflow-20261122
Nov 22, 2026
Merged

loopx-agent merged 2 commits into
mainfrom
codex/release-multi-surface-workflow-20261122

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Delivery Brief

  • Goal & Source: Upgrade LoopX's release workflow to reliably cover all four distribution surfaces (core CLI/PyPI/origin/stable, desktop App/Tauri updater/signing, dsh plugin/npm/awesome-dsh-plugin, and bilingual release notes + Feishu guide) following the v2.4.0 release and first-time npmjs OIDC Trusted Publisher onboarding for dsh-loopx-plugin.
  • Gap Observed:
    1. packages/dsh-loopx-plugin/scripts/verify-distribution.mjs queried /-/v1/search?text=repository:..., which npmjs does not restrict by repository; low-scoring 0.x/prerelease packages fell past rank 250 despite live npm publication.
    2. .github/workflows/dsh-plugin-publish.yml lacked clear diagnosis for the npmjs first-publish HTTP 404 OIDC catch-22 and Allow npm publish permission requirement, and previously ran tag-pinned verify-distribution.mjs rather than the latest verifier from main.
    3. Release readiness lacked one machine-readable offline + online preflight/readback script covering all four surfaces, and scripts/qualify_release_commit.py stripped the leading dot from .github/ paths via lstrip("./") before workflow preflight selection.
  • Observable Result & Owning Boundaries:
    • scripts/release_multi_surface_preflight.py: Reuses existing static release metadata and desktop artifact owners to provide loopx_multi_surface_release_preflight_v1 offline readiness checks and online readback across GitHub Releases, PyPI, npmjs (bootstrap_required / staging_scan_in_progress / published), awesome-dsh-plugin, and bilingual Feishu guide links.
    • packages/dsh-loopx-plugin/scripts/verify-distribution.mjs & smoke/dsh-registry-smoke.mjs: Adds maintainer:<username> search queries derived from published registry metadata plus --search-timeout-ms retry while preserving dsh-plugin anti-hijack keyword selection, backed by isolated smoke coverage.
    • .github/workflows/dsh-plugin-publish.yml, packages/dsh-loopx-plugin/README.md, docs/product/release-readiness.md: Emits structured DSH_NPM_PACKAGE_MISSING / DSH_NPM_STAGING_PLACEHOLDER errors, refreshes verify-distribution.mjs from origin/main for existing immutable tags, and documents the staged Multi-Surface Release Execution Pipeline (Stages 0–4).
    • scripts/qualify_release_commit.py: Replaces lstrip("./") with _normalize_rel_path, applies norecursedirs only to test paths, and maps release workflow / preflight / doc changes directly to their fast tests.

Validation

  • examples/release/release-readiness-doc-smoke.py & examples/docs-governance-smoke.py: passed
  • Focused pytest (tests/control_plane/test_release_multi_surface_preflight.py, tests/control_plane/test_release_commit_qualification.py, tests/test_dsh_plugin_publish_workflow.py, tests/desktop/test_desktop_signing_workflow.py): 44 passed, 32 subtests passed
  • ruff check & mypy --follow-imports=silent on changed Python scripts/tests: passed
  • scripts/release_multi_surface_preflight.py --require-clean --format json & --online --require-published --format json (against v2.4.0 & [email protected]): ok: true, published_complete: true
  • packages/dsh-loopx-plugin/smoke/dsh-registry-smoke.mjs --tarball <v0.1.1-beta.7.tgz> (pnpm 10.33.0): passed including maintainer: fallback and negative checks
  • loopx change-quality verify (cqr_2a54658b33d925a254f7, exact head 0dadc8463a69e13eb3cdd8e05aeb6a61d14e320b) & loopx canary premerge --from-git-diff --git-diff-base origin/main --goal-id personal-loopx-maintenance: passed (selected=19, failures=0, merge_gate_passed: true)

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer: model_agent · Gemini · Google · self_reported

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

经在独立工作树对精确提交 0dadc8463a69e13eb3cdd8e05aeb6a61d14e320b 进行代码逐行审计、反例复现及多端实测验证,结论为 REQUEST_CHANGES。PR 中的代码修复(verify-distribution.mjs maintainer: 回退查询、qualify_release_commit.py _normalize_rel_path 修复、dsh-plugin-publish.yml 首包 OIDC 诊断以及 release_multi_surface_preflight.py 核心框架)方向正确且聚焦测试通过,但新增的权威发布契约文档存在无法解析的错误 CLI 参数,且在线飞书检查会将不存在文档的登录重定向误报为 reachable: true,需修复后再合入。

动机 / Motivation

需要跨 Core CLI 与 PyPI、Desktop 安装器与 Tauri 热更新、dsh-loopx-plugin 与 npmjs / awesome-dsh-plugin 以及双语 Release Notes 与个人飞书指南同步发布并回读验证的发布维护者及自动化发布 Agent。

改动前,dsh-loopx-plugin 因 0.x 预发布包评分较低且 npmjs 搜索对 repository 限定词仅按分词排序,常掉出前 250 名导致 verify-distribution.mjs 误报未上架;dsh-plugin-publish.yml 对首次发包 HTTP 404 的 OIDC Trusted Publisher 鸡生蛋问题缺少明确诊断且只运行 tag 冻结的旧脚本;qualify_release_commit.py 用 lstrip('./') 会把 .github/workflows/ 的前导点号剥成 github/workflows/ 并在 norecursedirs='.*' 下提前跳过映射,且缺少统一的多端发布前巡检脚本。改动后,verify-distribution.mjs 补充 maintainer: 查询与 --search-timeout-ms 重试并保留 dsh-plugin 防劫持选择;dsh-plugin-publish.yml 增加 404/0.0.0-stage 报错引导并刷新 origin/main 的校验脚本;qualify_release_commit.py 修复路径归一化与测试映射;新增 release_multi_surface_preflight.py 与 release-readiness.md 多端流水线章节,但实测新增文档中的 Stage 1 命令与实际脚本参数不符,且在线飞书校验会把不存在文档的登录重定向误判为可达。

实测 verify-distribution.mjs 针对真实 [email protected] 在线回读通过,dsh-registry-smoke.mjs 覆盖 maintainer 回退与防劫持/完整性负向校验并全部通过,release_multi_surface_preflight.py 离线与在线针对 v2.4.0 均返回 ok=true,63 项相关 pytest(含 45 subtests)与双语文档 smoke 通过;同时对抗复现确认 docs/product/release-readiness.md Stage 1 的 --execute 命令直接报错退出,_check_notes 对不存在飞书文档 ID 返回 HTTP 200 reachable=true。

本 PR 不修改 Core 控制面状态机、不修改 origin/stable 或任何 Git 发布 tag、不代为申请或修改 npmjs Trusted Publisher 账户权限,也不执行实际的 PyPI、Desktop 或 npm 线上发版。

当前遗留阻塞缺口:docs/product/release-readiness.md Stage 1/2 需修正为真实可运行的脚本参数(--qualification-id、--output-dir、--manifest-json 及工作流独立触发说明),scripts/release_multi_surface_preflight.py 需避免将飞书登录页重定向误判为文档可读并补全缺失标题/HTTP 失败时的 remediations。

改动思路 / Approach

本 PR 在不重打冻结插件 tag 且不破坏控制面与脚本隔离前提下,将多端发布链路拆成“静态契约复用 + 在线真实回读 + CI 错误自诊断”三层:

  1. 多端预检入口与既有权威复用:scripts/release_multi_surface_preflight.py 通过 runpy.run_path 加载 loopx/control_plane/testing/release_metadata.py 与 scripts/desktop_release_artifacts.py,做到不 import loopx 即可校验 core、desktop、dsh、notes 四端本地一致性与远端发布状态(GitHub Releases、PyPI、npmjs、awesome-dsh-plugin、Feishu 链接)。
  2. DSH npmjs 发现与发布排障闭环:针对 0.1.1-beta.7 线上暴露的 repository:loopx-project/loopx 返回 66 万余条无过滤结果导致插件掉出前 250 名的问题,verify-distribution.mjs 从已发布元数据提取 maintainers 拼接 maintainer:<username> 查询并做去重合并,同时保留原有的 github.com/<repo> 过滤与 dsh-plugin 关键词优先防劫持逻辑;.github/workflows/dsh-plugin-publish.yml 则在发布失败时区分 404 首包未建档、0.0.0-stage 扫描中与 Trusted Publisher 配置错误,并在最后一步从 origin/main 拉取最新 verify-distribution.mjs 而不改变不可变 tag 的构建源码与产物。
  3. 预检测试映射修复:scripts/qualify_release_commit.py 修复了 .lstrip("./") 吃掉 .github/ 前导点号及 norecursedirs 里的 ".*" 阻断工作流文件触发测试的双重缺陷。

release_multi_surface_preflight.py 直接通过 runpy 复用既有 release_metadata.py 与 desktop_release_artifacts.py 的静态契约,不引入平行的包元数据权威或控制面运行时依赖;verify-distribution.mjs 在原有 repository 搜索契约上就地叠加 maintainer 查询与超时重试,qualify_release_commit.py 仅修补路径归一化与映射表,整体边界克制且可独立回滚。

当前 PR 边界:本 PR 应仅覆盖多端预检 CLI、DSH npmjs 发现/发布诊断修复、qualify_release_commit.py 映射修复及对应的准确文档与测试,待修正 release-readiness.md 不可执行命令与 _check_notes 飞书假阳性/空 remediation 缺陷后即可合入。

具体改动 / Changes

  • 规范基线映射 (spec_basis):对照改动前主干接受契约 docs/product/release-readiness.md(基线提交 2ab0d1a42b3ae7e729dcb9d6e2d28157100587dc)评审以下三项要求:
    • DSH-DISCOVERY-READBACK(已满足 / implemented):要求不重建不可变 tag 产物而完整回读 npm 元数据、latest、tarball 摘要与 DSH Hub 仓库发现;由 packages/dsh-loopx-plugin/scripts/verify-distribution.mjs、packages/dsh-loopx-plugin/smoke/dsh-registry-smoke.mjs 与 .github/workflows/dsh-plugin-publish.yml 实现并通过实测与隔离 registry smoke。
    • NAMED-VERSION-STATIC-CONTRACT(已满足 / implemented):要求不启动候选 loopx 包即可读取 pyproject.toml 与 loopx.__version__ 一致性并校验 origin/stable 祖先关系;由 scripts/release_multi_surface_preflight.py 的 _load_core_metadata 与 _check_core 复用静态读取器实现并通过单测与 --require-clean 校验。
    • RELEASE-PIPELINE-AND-FEISHU-READBACK(未满足 / not_met):要求发布契约文档给出可直接执行的验证命令且飞书引导页校验如实区分文档可读性与未认证占位页面;当前 docs/product/release-readiness.md Stage 1/2 存在不可运行参数与错误级联描述,且 scripts/release_multi_surface_preflight.py _check_notes 将登录墙重定向误判为 reachable: true。

关键代码讲解

  1. scripts/release_multi_surface_preflight.py(_check_core、_check_desktop、_check_dsh、_check_notes、run_preflight)

    • 入口 run_preflight 汇总四端检查,输出仅保留 repo_root.name(无本地绝对路径),按 ready_for_local_qualification 与 published_complete 判定退出码。
    • _check_core / _check_desktop 复用静态版本与桌面四件套名称契约,--online 校验 v<ver> 与 desktop-stable 上的 desktop-updater.json 及 LoopX.app.tar.gz(.sig)、PyPI 版本;_check_dsh 将 npmjs 响应分类为 bootstrap_required(404)、staging_scan_in_progress(仅 0.0.0-stage)、published(版本存在且 latest 匹配)及 tag_or_version_mismatch,并核对 awesome-dsh-plugin 目录 YAML tarball: 字段。
    • 缺陷点在 _check_notes:在线检测 https://my.feishu.cn/docx/... 仅依据 code < 400,未能识别 Feishu 对匿名请求一律跳转至 accounts.feishu.cn/accounts/page/login 的行为,且缺少决策标题或 HTTP 失败时不会追加 remediations。
  2. packages/dsh-loopx-plugin/scripts/verify-distribution.mjs(searchRepositoryCandidates、--search-timeout-ms)

    • 在通过 published.versions[version]、dist-tags.latest 与 tarball SHA-512 完整性校验后,从 published.maintainers 与 version.maintainers 提取最多 5 个维护者,构造 ['repository:<repo>', 'maintainer:<name>', ...] 查询序列。
    • searchRepositoryCandidates 按 pkg.package.name 去重合并后,仍统一经过 repoSlug(...) 包含 github.com/<repo> 的过滤与优先选择含 dsh-plugin 关键词包的断言,保留了原有的仓库归属与防同名劫持边界。
    • 实测在 npmjs 上 repository:loopx-project/loopx 前 250 条未含该包,而 maintainer:huangrt01 精确返回 dsh-loopx-plugin 并通过全部回读校验。
  3. .github/workflows/dsh-plugin-publish.yml & packages/dsh-loopx-plugin/README.md

    • 下载阶段额外探测 DSH_NPM_PACKAGE_MISSING(404)与 DSH_NPM_STAGING_PLACEHOLDER(仅 0.0.0-stage),当 npm publish --provenance 失败时输出包含 auth-and-writes 2FA 首包引导、Allow npm publish 勾选及空白 Environment name 的结构化 ::error 提示。
    • 末步通过 git show origin/main:packages/dsh-loopx-plugin/scripts/verify-distribution.mjs > scripts/verify-distribution.mjs 刷新只读校验脚本,使旧 tag 无需重新发布即可享受 maintainer: 发现修复,同时保留不可变 tag 的构建源码与 tarball 字节验证。
  4. scripts/qualify_release_commit.py(_normalize_rel_path、select_preflight_tests)

    • 将多处手写的 .lstrip("./") 替换为 _normalize_rel_path,彻底修复 .github/... 被误截成 github/... 导致规则失效的历史 bug。
    • 将 _is_excluded_by_norecursedirs(rel, norecursedirs) 收缩到仅对直接测试路径 _is_direct_test_path(rel) 生效,避免 pyproject.toml 中的 ".*" 把 .github/workflows/*.yml 整体过滤,从而使新增的工作流、预检脚本与 release-readiness.md 映射能命中对应快测。
  5. docs/product/release-readiness.md & 新增/更新测试

    • 在 release-readiness.md 新增 Stage 0–4《Multi-Surface Release Execution Pipeline》与中文精要并更新 v2.4.0 目录中的 npm / awesome-dsh-plugin#17660 状态;在 tests/control_plane/test_release_multi_surface_preflight.py、tests/control_plane/test_release_commit_qualification.py、tests/test_dsh_plugin_publish_workflow.py 与 packages/dsh-loopx-plugin/smoke/dsh-registry-smoke.mjs 中补充了结构、离线边界、npm 状态机与 maintainer: 回退测试。

对主干的风险 / Risks

1. [P1 - Blocking] docs/product/release-readiness.md 新增多端发布流程存在不可执行命令与错误工作流触发说明

  • 触发路径:维护者或发布 Agent 遵循 Status: stable maintainer contract. 文档 docs/product/release-readiness.md#L452-L521 执行 Stage 1 / Stage 2。
  • 代码位置与事实证据:
    1. L461 (Lane B) 记录 uv run --extra test python scripts/qualify-doubao-model-behavior-live.py --execute。实测该脚本并无 --execute 参数,且 --qualification-id 为必填项,直接执行以退出码 2 报错:error: the following arguments are required: --qualification-id。
    2. L468-L470 (Lane D) 记录 uv run --extra test python scripts/qualify_release_commit.py --execute 及 loopx canary release-qualification。实测 scripts/qualify_release_commit.py 并无 --execute 参数且 --output-dir 为必填项(报错退出码 2:error: the following arguments are required: --output-dir),loopx canary release-qualification 亦要求必填 --manifest-json,直接与同文件 L1202–L1210 已存在的正确命令格式冲突。
    3. L466 (Lane C) 写出 npm run smoke:personal-workspace-packaged,仓库根目录 package.json 并无该脚本(位于 apps/presentation/dashboard/package.json,正确用法见 docs/development/frontend-delivery.md 的 --prefix apps/presentation/dashboard)。
    4. L476-L477 & L519 (Stage 2) 写出 desktop-release-artifacts.yml -> desktop-updater.yml / “级联 desktop-updater.yml”,而 .github/workflows/desktop-updater.yml(L10–L14)实际由 release: types: [published] 或 workflow_dispatch 独立触发,并非由 desktop-release-artifacts.yml 级联触发;且 dsh-plugin-publish.yml 仅支持 workflow_dispatch 并要求非草稿 GitHub Release 已发布,无法仅靠推 tag 并发自动触发。
  • 最小修复:将 Lane B/C/D 命令修订为各自真实 CLI 签名(补充 --qualification-id、--output-dir、--manifest-json、--prefix apps/presentation/dashboard 并移除不存在的 --execute),并将 Stage 2 说明更正为 release: published 独立并发触发及 GitHub Release 发布后 workflow_dispatch 触发 dsh-plugin-publish.yml。
  • 验证/回归方法:逐条执行文档中 CLI 的 --help 与 --preflight-since / --output-dir 最小冒烟确认参数合法,并核对工作流 on: 触发器测试。

2. [P1 - Blocking] scripts/release_multi_surface_preflight.py _check_notes 在线飞书校验存在假阳性且部分失败路径缺少 remediation

  • 触发路径:执行 scripts/release_multi_surface_preflight.py --online --require-published,或 release note 存在但缺少决策标题 / 飞书 URL 返回 HTTP 错误。
  • 代码位置与事实证据:
    1. _check_notes(L992–L1007)以 _http_get_text(url) 返回 code < 400 即判定 reachable=True 与 published_ok=True。实测对抗反例:真实文档 https://my.feishu.cn/docx/JXvbdWcFDoZJgvxktvScYfJwnRf 因登录跳转循环抛出 HTTPError 302(输出 "reachable": true, "error": "HTTP 302"),而完全不存在的伪造文档 https://my.feishu.cn/docx/NonExistentDocId9999999 跳转至 accounts.feishu.cn/accounts/page/login 后同样返回 HTTP 200 并被判定为 reachable: true / published_ok: true,无法区分失效/私有/伪造飞书文档。
    2. _check_notes(L964–L980、L999–L1007):当 v<ver>.md 存在且无违禁字符串但缺少 ## Release Decision 或 ### 升级决策 时,local_ok 置为 False 但 remediations 为空;当非空 feishu_urls 在线检测返回 code >= 400 或网络失败时,published_ok 置为 False 但同样无任何 remediations 条目。
  • 最小修复:不要将重定向至 accounts.feishu.cn/accounts/page/login 的 HTTP 200/302 标为已验证可达(明确记录 auth_redirect_unverified 状态并提示需通过用户态 lark-cli 或浏览器实名回读确认权限与图文内容),同时为缺失决策标题与飞书 HTTP 失败路径补充明确 remediations 与单测。

3. [P2 - Non-blocking] 次要改进与未覆盖边界

  • 桌面稳定 feed 版本一致性未核验(scripts/release_multi_surface_preflight.py#L724-L732):desktop_stable_feed_ok 仅检查 desktop-stable Release 存在 desktop-updater.json 文件名,未检查其中 JSON 的 version 是否等于 core_version(若 desktop-stable 仍指向旧版本 2.3.0,在 v2.4.0 资产齐全时仍会返回 true)。
  • 代理剥离注释与参数不一致(scripts/release_multi_surface_preflight.py#L1151-L1153):注释称“unless caller opted out explicitly”,但 build_parser() 尚未提供保留代理的 CLI 选项。
  • DSH OpenSearch 超时重试路径未在 smoke 实测(packages/dsh-loopx-plugin/scripts/verify-distribution.mjs#L88-L92 与 smoke/dsh-registry-smoke.mjs#L115-L132):若同仓库有其他非 dsh-plugin npm 包先返回导致 candidates.length > 0,while (candidates.length === 0 && ...) 会提前退出而不重试;且 dsh-registry-smoke.mjs 在 maintainer: 回退和负向用例上均传 --search-timeout-ms 0,未在测试中覆盖“首次空结果、重试后成功”的正向轮询分支。

范围适配、隔离与独立验证汇总

  • Scope fit & 复用:新增脚本与测试均挂接于明确文档或工作流/预检调用点;FORBIDDEN_NOTE_PATTERNS 与 examples/release/release-readiness-doc-smoke.py 共有 8 个常量字串,因需保持 scripts/ 不导入候选 loopx 包而独立保留可接受。所有新增逻辑均有确定性单元与隔离集成测试覆盖,无隐式默认行为改变或域特定控制面泄漏。
  • 独立验证结果(exact head 0dadc8463a69e13eb3cdd8e05aeb6a61d14e320b):
    • 聚焦 pytest(test_release_multi_surface_preflight.py、test_release_commit_qualification.py、test_dsh_plugin_publish_workflow.py、test_desktop_signing_workflow.py、test_update_feed.py):PASS(63 passed, 45 subtests passed)。
    • ruff check & python -m mypy(17 个仓库配置范围文件)& mypy --follow-imports=silent(3 个新增/修改脚本及测试文件):PASS(注:已有测试 test_release_commit_qualification.py 与 test_dsh_plugin_publish_workflow.py 位于 [tool.mypy] 范围之外,额外运行 mypy 会因缺 types-PyYAML 与历史 untyped fixture 报错)。
    • 发布与文档治理 smoke(release-readiness-doc-smoke.py、docs-governance-smoke.py、release-version-contract-smoke.py、exact-release-commit-qualification-smoke.py、scripts/check_rfc_bilingual.py、loopx check、git diff --check、git merge-tree HEAD origin/main):PASS。
    • 多端预检实测(release_multi_surface_preflight.py --require-clean 与 --online --require-published 对 v2.4.0):PASS(ok=true, published_complete=true, 输出无本地绝对路径)。
    • DSH 实测(verify-distribution.mjs --tarball ... 对线上 [email protected] 与 npmjs 实网查询;以及在独立临时副本中运行 pnpm build / typecheck / dsh-registry-smoke.mjs):PASS(另 vitest 中依赖源码根路径回查的 2 个集成文件因隔离副本不在原仓库树内而出现 14 项 PYTHONPATH 路径解析失败,13 个单元测试文件 345 项全部通过)。

我的整体评价 / Verdict

  • 长程影响 (long_horizon: improved):多端发布前预检、.github 测试映射修复及 dsh-plugin-publish.yml 首包 OIDC 报错和 origin/main 校验脚本刷新显著降低了跨表面发版的阻塞与人工排查成本。
  • 用户体验 (user_experience: regression):虽然新增预检与 DSH 发现代码本身可用,但同 PR 写入稳定契约文档 docs/product/release-readiness.md 的 Stage 1 核心命令含不存在的 --execute 参数且缺少必填参数、Stage 2 触发链描述有误,同时 _check_notes 将不存在飞书文档的登录跳转判定为 reachable: true 且部分失败缺少修复提示,属于可复现的发布操作体验退化。
  • 可视化审查 (visual_review: not_applicable):No frontend UI or visual presentation surface changed; this PR touches release CLI scripts, GitHub Actions YAML, and maintainer Markdown docs. 未覆盖范围:none。
  • 可观测语义与兼容性 (observable_semantics: unintended_drift / code_volume: necessary / compatibility_assessment: retain):verify-distribution.mjs 保持已有 CLI 与防劫持契约并向前兼容 --search-timeout-ms;qualify_release_commit.py 修复前导点与测试过滤语义;但 release-readiness.md 新章节命令与仓库已有 --output-dir / --qualification-id / --manifest-json CLI 契约发生漂移。
  • 架构与权限契约:change_proportionality 为 proportionate(architecture_assessment: retain),default_off_isolation、authority_semantics 与 semantic_alignment 均为 not_applicable(无新增共享控制面枚举、Actor 生命周期或默认开关变更)。

请作者修复上述两项 P1 阻塞项(更新 docs/product/release-readiness.md Stage 1/2 真实可执行命令与触发关系;修正 scripts/release_multi_surface_preflight.py _check_notes 飞书登录重定向假阳性判定并补全缺失标题/HTTP 失败的 remediations)及建议同步处理 P2 细节后,于新 commit 重新发起审查。

English verdict: REQUEST_CHANGES at head 0dadc84 — blocking P1 defects in docs/product/release-readiness.md (nonexistent --execute CLI flags and inaccurate desktop-updater cascade) and scripts/release_multi_surface_preflight.py (_check_notes false-positive reachable=true on Feishu login redirects and missing remediations); focused pytest, ruff, release/doc smokes, online preflight, and DSH registry checks passed.

@loopx-agent
loopx-agent force-pushed the codex/release-multi-surface-workflow-20261122 branch from 0dadc84 to 38b7fff Compare November 22, 2026 05:59

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewer: model_agent · Gemini · Google · self_reported

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

经对 PR #9244 最新精确提交 38b7fffdb54de3b7d9329fb4dba5e1f8217eac32(基于 75af6157724794366d9da7b9ce34f076fb7f4997)执行全量 base-to-head 独立复审,确认此前审查(6010574874,head 0dadc8463a69e13eb3cdd8e05aeb6a61d14e320b)指出的两项 P1 阻塞项及全部 P2 建议均已修复到位且经过独立测试与线上回读验证,无未解决阻塞缺陷,结论为 APPROVE。

动机 / Motivation

需要跨 Core CLI 与 PyPI、Desktop 安装器与 Tauri 热更新、dsh-loopx-plugin 与 npmjs / awesome-dsh-plugin 以及双语 Release Notes 与个人飞书指南同步发布并回读验证的发布维护者及自动化发布 Agent。

改动前,dsh-loopx-plugin 因 0.x 预发布包评分较低且 npmjs 搜索对 repository 限定词仅按分词排序,常掉出前 250 名导致 verify-distribution.mjs 误报未上架;dsh-plugin-publish.yml 对首次发包 HTTP 404 的 OIDC Trusted Publisher 鸡生蛋问题缺少明确诊断且只运行 tag 冻结的旧脚本;qualify_release_commit.py 用 lstrip('./') 会把 .github/workflows/ 的前导点号剥成 github/workflows/ 并在 norecursedirs='.*' 下提前跳过映射,且缺少统一的多端发布前巡检脚本。改动后(含相对前次审查 0dadc84 的阻塞修复),verify-distribution.mjs 补充 maintainer: 查询、--search-timeout-ms / --search-poll-ms 重试并保留 dsh-plugin 防劫持选择;dsh-plugin-publish.yml 增加 404/0.0.0-stage 报错引导并刷新 origin/main 校验脚本;qualify_release_commit.py 修复路径归一化与测试映射;release_multi_surface_preflight.py 与 release-readiness.md Stage 0-4 提供准确可运行的四端本地预检与线上回读。

实测 verify-distribution.mjs 针对真实 [email protected] 在线回读通过,dsh-registry-smoke.mjs 覆盖 maintainer 回退、延迟索引轮询与防劫持/完整性负向校验并全部通过;release_multi_surface_preflight.py 离线与在线针对 v2.4.0 均返回 ok=true、published_complete=true,且能识别缺少中文决策标题、飞书链接缺失、desktop-stable 更新清单版本偏移及 --keep-proxy 行为;64 项聚焦 pytest(含 45 subtests)、ruff、mypy 及全套双语/发布文档 smoke 全部通过。

本 PR 不修改 Core 控制面状态机、不修改 origin/stable 或任何 Git 发布 tag、不代为申请或修改 npmjs Trusted Publisher 账户权限,也不执行实际的 PyPI、Desktop 或 npm 线上发版。

自上次审查以来的阻塞修复核验(0dadc8463a69e13eb3cdd8e05aeb6a61d14e320b -> 38b7fffdb54de3b7d9329fb4dba5e1f8217eac32)

  1. 已解决 P1-1(docs/product/release-readiness.md#L452-L523):移除不存在的 --execute 参数,Stage 1 Lane B 改为 --qualification-id <release-qual-id> --repo-root .,Lane C 改为 npm --prefix apps/presentation/dashboard run smoke:personal-workspace-packaged,Lane D 改为真实存在的 --repo-root . --output-dir .local/release-qualification --preflight-since <previous-tag> --resume 与 loopx canary release-qualification --manifest-json <release-qualification-manifest.json> --repo-root .;Stage 2 中英文同步修正为 desktop-updater.yml 按 Release 发布事件(或 workflow_dispatch)运行、dsh-plugin-publish.yml 经 workflow_dispatch 执行,不再写错误的 -> 级联关系。
  2. 已解决 P1-2(scripts/release_multi_surface_preflight.py#L559-L667):移除会对飞书登录重定向返回假阳性 reachable: true 的匿名 HTTP 探测;改为在线校验非草稿 GitHub Release v<version> 的正文是否含双语决策段落、无违禁字符串且链接全部飞书指南 URL,并明确标注 feishu_doc_verification: "requires_authenticated_lark_cli";同时补齐本地缺失双语决策标题时的 release_note_bilingual_sections_incomplete 修复提示。
  3. 已解决 P2 细节:_check_desktop 在线拉取 desktop-stable/desktop-updater.json 验证 platforms 非空及 version == core_version;build_parser() 新增 --keep-proxy 匹配注释语义;verify-distribution.mjs 新增 --search-poll-ms 并将轮询终止条件修正为 selected?.package.name !== manifest.name,dsh-registry-smoke.mjs 补充了“首个 poll 仅返回 loopx-cli、第二次 poll 才索引到 dsh-loopx-plugin”的正向延迟索引实测。

改动思路 / Approach

本 PR 在不重打冻结插件 tag 且不破坏控制面与脚本隔离前提下,形成“静态契约复用 + 跨端线上真实回读 + 发布工作流自诊断”闭环:

  1. 多端预检与真实产物回读:scripts/release_multi_surface_preflight.py 通过 runpy.run_path 加载既有 release_metadata.py 与 desktop_release_artifacts.py,离线验证四端声明、origin/stable 祖先关系、manpage 与文档公共边界;--online 进一步核对 GitHub Release 资产、PyPI 版本、desktop-stable/desktop-updater.json 内容版本、npmjs 状态分类(bootstrap_required / staging_scan_in_progress / published / tag_or_version_mismatch)、awesome-dsh-plugin 目录 tarball: 及远端 GitHub Release 正文对飞书指南的引用。
  2. DSH npmjs 发现与发布排障闭环:针对 0.1.1-beta.7 在 npmjs repository:loopx-project/loopx 前 250 名外掉榜的问题,verify-distribution.mjs 合并最多 5 个 maintainer:<name> 查询并按 selectPluginCandidate 持续轮询至 --search-timeout-ms,同时保留 github.com/<repo> 过滤与 dsh-plugin 关键词防劫持断言;dsh-plugin-publish.yml 则补充 404 首包建档与 0.0.0-stage 扫描中的结构化 ::error 诊断,并从 origin/main 刷新 scripts/verify-distribution.mjs。
  3. 预检测试映射修复:scripts/qualify_release_commit.py 修复 .lstrip("./") 损坏 .github/ 前导点及 norecursedirs 里的 ".*" 提前跳过工作流路径的双重缺陷。

release_multi_surface_preflight.py 通过 runpy 复用既有 release_metadata.py 与 desktop_release_artifacts.py 的静态契约,不引入平行的包元数据权威或控制面运行时依赖;verify-distribution.mjs 在原有 repository 搜索契约上就地叠加 maintainer 查询与插件候选轮询,qualify_release_commit.py 仅修补路径归一化与映射表,整体边界克制、可测试且可独立回滚。

当前 PR 边界:本 PR 严格限定在多端预检 CLI、DSH npmjs 发现与 CI 诊断修复、qualify_release_commit.py 路径修复及对应的 release-readiness.md / README 文档与测试,不涉及 Core 运行时状态变更或线上发布写操作。

具体改动 / Changes

  • 规范基线映射 (spec_basis):对照改动前主干契约 docs/product/release-readiness.md(基线提交 75af6157724794366d9da7b9ce34f076fb7f4997)评审以下三项:
    • DSH-DISCOVERY-READBACK(已满足 / implemented):完整回读 npm 元数据、latest、tarball 完整性与 DSH Hub 发现,且不重打或破坏不可变 tag 产物;由 packages/dsh-loopx-plugin/scripts/verify-distribution.mjs、packages/dsh-loopx-plugin/smoke/dsh-registry-smoke.mjs 与 .github/workflows/dsh-plugin-publish.yml 实现并通过。
    • NAMED-VERSION-STATIC-CONTRACT(已满足 / implemented):不启动候选 loopx 包即可读取 pyproject.toml 与 loopx.__version__ 并校验 origin/stable 祖先;由 scripts/release_multi_surface_preflight.py 的 _load_core_metadata 与 _check_core 实现并通过。
    • RELEASE-PIPELINE-AND-FEISHU-READBACK(已满足 / implemented):提供与仓库真实 CLI 契约一致的 Stage 0-4 操作指南及如实的线上发布正文与飞书路由边界;由 docs/product/release-readiness.md 与 scripts/release_multi_surface_preflight.py _check_notes 实现并通过。

关键代码讲解

  1. scripts/release_multi_surface_preflight.py(_check_desktop、_check_notes、build_parser、run_preflight)

    • _check_desktop(L322-L388)不仅校验 v<ver> 与 desktop-stable Release 资产名,还会下载 desktop-stable/desktop-updater.json 校验 platforms 非空及 version == core_version,版本偏差时产出 desktop_updater_feed_version_mismatch 失败并阻塞 --require-published。
    • _check_notes(L559-L667)本地校验双语决策标题与公共边界(缺失标题时发出 release_note_bilingual_sections_incomplete);在线模式读取非草稿 GitHub Release v<ver> 正文检查双语决策段落、违禁字符串及 Feishu URL 完整性,并标注 feishu_doc_verification: "requires_authenticated_lark_cli",彻底消除匿名登录墙假阳性。
    • build_parser / main(L805-L833)新增 --keep-proxy 供需走代理的环境显式保留 HTTP(S)_PROXY/ALL_PROXY,输出中仅暴露 repo_root.name 无本地绝对路径。
  2. packages/dsh-loopx-plugin/scripts/verify-distribution.mjs & packages/dsh-loopx-plugin/smoke/dsh-registry-smoke.mjs

    • verify-distribution.mjs 提取 selectPluginCandidate(candidates) 复用 dsh-plugin 关键词优先选择与防劫持断言,新增 --search-poll-ms(默认 3000 ms),并将重试条件从 candidates.length === 0 改为 selected?.package.name !== manifest.name,即使同仓存在先入库的非插件包也能持续等待直至插件完成索引或超时失败。
    • dsh-registry-smoke.mjs 在隔离本地 registry 增加了 delayedRepoSearchAttemptsRemaining = 1 场景,先返回 loopx-cli 再返回完整数组,实际走通轮询等待分支,同时保留 maintainer: 回退与错误 tag / 劫持 / 摘要不匹配的负向断言。
  3. .github/workflows/dsh-plugin-publish.yml & packages/dsh-loopx-plugin/README.md

    • 在下载阶段探测 DSH_NPM_PACKAGE_MISSING 与 DSH_NPM_STAGING_PLACEHOLDER,发布失败时输出含 auth-and-writes 2FA 首包引导、blank Environment name 与 Allow npm publish checked 的结构化 ::error 提示;末步刷新 origin/main 的 verify-distribution.mjs 进行只读校验。
  4. scripts/qualify_release_commit.py & docs/product/release-readiness.md

    • _normalize_rel_path 替换 .lstrip("./") 并仅对 _is_direct_test_path 应用 norecursedirs,恢复 .github/workflows/*.yml、scripts/release_multi_surface_preflight.py 与 docs/product/release-readiness.md 到各自快测模块的映射;release-readiness.md 的 Stage 0-4 流程与中文精要现已对齐真实 CLI 参数与工作流触发语义。

对主干的风险 / Risks

经排查无阻塞性主干回归风险(no blocking finding);仅记录以下次要非阻塞观察与残余风险:

  • [P2 - Non-blocking] Stage 2 触发方式表述细节(docs/product/release-readiness.md#L474-L476 & L521):正文写为“push annotated tags ... to trigger release-artifacts.yml and desktop-release-artifacts.yml”,实际这两个工作流的 on: 触发器监听的是 release: types: [published] 与 workflow_dispatch(非裸 push: tags 事件;即需随 tag 发布非草稿 Release 或使用 workflow_dispatch -f tag=... 触发)。因后半句已明确“once the non-draft ... GitHub Releases are published”,不构成阻塞,可在后续文档润色中顺手补充。
  • 残余边界与未覆盖维度:release_multi_surface_preflight.py 故意不调用有状态的 lark-cli 以保持无认证只读边界,因此个人飞书文档的正文与截图可读性仍需按 release-readiness.md#L1485-L1533 独立执行认证态回读;dsh-plugin-publish.yml 实际 OIDC 发布步骤与 Windows 桌面打包未在本地重跑(仅通过工作流结构校验、隔离 smoke 与已发布 v2.4.0 / 0.1.1-beta.7 线上资产回读验证)。

范围适配、隔离与独立验证结果(exact head 38b7fffdb54de3b7d9329fb4dba5e1f8217eac32)

  • Scope fit & 复用:新增脚本、测试与文档均有明确调用点;FORBIDDEN_NOTE_PATTERNS 保留于 scripts/release_multi_surface_preflight.py 以维持不导入候选 loopx 包的静态前提。无未披露默认行为变化,无控制面域绑定。
  • 验证矩阵(全部在 38b7fffdb54de3b7d9329fb4dba5e1f8217eac32 独立复现):
    • 聚焦 pytest(test_release_multi_surface_preflight.py、test_release_commit_qualification.py、test_dsh_plugin_publish_workflow.py、test_desktop_signing_workflow.py、test_update_feed.py):PASS(64 passed, 45 subtests passed)。
    • ruff check & python -m mypy(17 个仓库配置范围文件)& mypy --follow-imports=silent(release_multi_surface_preflight.py、qualify_release_commit.py、test_release_multi_surface_preflight.py):PASS。
    • 发布与文档治理 smoke(release-readiness-doc-smoke.py、docs-governance-smoke.py、release-version-contract-smoke.py、exact-release-commit-qualification-smoke.py、scripts/check_rfc_bilingual.py、loopx check、git diff --check、git merge-tree HEAD origin/main):PASS。
    • 多端预检实测(release_multi_surface_preflight.py --require-clean 与 --online --require-published 对 v2.4.0):PASS(ok=true, published_complete=true, updater_feed_version="2.4.0", feishu_doc_verification="requires_authenticated_lark_cli", 无本地绝对路径泄漏)。
    • DSH 实测(隔离副本 pnpm build / pnpm typecheck / dsh-registry-smoke.mjs 含延迟索引轮询正向用例,以及 verify-distribution.mjs --tarball ... 对线上 [email protected] 与 npmjs 实网查询):PASS。

我的整体评价 / Verdict

  • 长程影响 (long_horizon: improved):跨四端发布前预检、.github 预检测试映射修复、DSH npmjs maintainer: 回退与延迟索引轮询及 OIDC 引导显著提升了发版可靠性并减少跨端故障定位轮次。
  • 用户体验 (user_experience: improved):相对 0dadc8463a69e13eb3cdd8e05aeb6a61d14e320b 已修正全部不可执行文档命令、补充 --keep-proxy 与缺失双语标题提示,并校验 desktop-stable/desktop-updater.json 版本与 GitHub Release 正文飞书链接,使发布前/后 CLI 回读体验连贯且真实。
  • 可视化审查 (visual_review: not_applicable):No frontend UI or visual presentation surface changed; this PR touches release CLI scripts, GitHub Actions YAML, and maintainer Markdown docs. 未覆盖范围:none。
  • 可观测语义与兼容性 (observable_semantics: intentional_change_validated / code_volume: necessary / compatibility_assessment: retain):verify-distribution.mjs、qualify_release_commit.py 与 release-readiness.md 新增与修复项均经正反例实测并与既有 CLI 契约一致。
  • 架构与权限契约:change_proportionality 为 proportionate(architecture_assessment: retain),default_off_isolation、authority_semantics 与 semantic_alignment 均为 not_applicable(无新增控制面共享枚举、Actor 生命周期或默认开关变更)。

English verdict: APPROVE at head 38b7fff — all P1 and P2 findings from prior review 6010574874 are resolved and verified across 64 pytest cases, ruff, scoped mypy, release/doc smokes, offline/online multi-surface preflight, and live/isolated DSH distribution checks.

@loopx-agent
loopx-agent merged commit 3a825d4 into main Nov 22, 2026
9 of 11 checks passed
@loopx-agent
loopx-agent deleted the codex/release-multi-surface-workflow-20261122 branch November 22, 2026 06:04
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.

1 participant