Repository navigation
Upgrade multi-surface release preflight, DSH npmjs discovery, and release pipeline - #9244
Conversation
loopx-agent
left a comment
There was a problem hiding this comment.
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 错误自诊断”三层:
- 多端预检入口与既有权威复用:
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 链接)。 - 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 的构建源码与产物。 - 预检测试映射修复:
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.mdStage 1/2 存在不可运行参数与错误级联描述,且scripts/release_multi_surface_preflight.py_check_notes将登录墙重定向误判为reachable: true。
关键代码讲解
-
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目录 YAMLtarball:字段。- 缺陷点在
_check_notes:在线检测https://my.feishu.cn/docx/...仅依据code < 400,未能识别 Feishu 对匿名请求一律跳转至accounts.feishu.cn/accounts/page/login的行为,且缺少决策标题或 HTTP 失败时不会追加remediations。
- 入口
-
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并通过全部回读校验。
- 在通过
-
.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-writes2FA 首包引导、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 字节验证。
- 下载阶段额外探测
-
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映射能命中对应快测。
- 将多处手写的
-
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。 - 代码位置与事实证据:
- 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。 - 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 已存在的正确命令格式冲突。 - 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)。 - 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 并发自动触发。
- L461 (Lane B) 记录
- 最小修复:将 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 错误。 - 代码位置与事实证据:
_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,无法区分失效/私有/伪造飞书文档。_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-stableRelease 存在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-pluginnpm 包先返回导致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-jsonCLI 契约发生漂移。 - 架构与权限契约:
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.
…ease pipeline Signed-off-by: LoopX Agent <[email protected]>
Signed-off-by: LoopX Agent <[email protected]>
0dadc84 to
38b7fff
Compare
loopx-agent
left a comment
There was a problem hiding this comment.
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)
- 已解决 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执行,不再写错误的->级联关系。 - 已解决 P1-2(
scripts/release_multi_surface_preflight.py#L559-L667):移除会对飞书登录重定向返回假阳性reachable: true的匿名 HTTP 探测;改为在线校验非草稿 GitHub Releasev<version>的正文是否含双语决策段落、无违禁字符串且链接全部飞书指南 URL,并明确标注feishu_doc_verification: "requires_authenticated_lark_cli";同时补齐本地缺失双语决策标题时的release_note_bilingual_sections_incomplete修复提示。 - 已解决 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 且不破坏控制面与脚本隔离前提下,形成“静态契约复用 + 跨端线上真实回读 + 发布工作流自诊断”闭环:
- 多端预检与真实产物回读:
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 正文对飞书指南的引用。 - DSH npmjs 发现与发布排障闭环:针对
0.1.1-beta.7在 npmjsrepository: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。 - 预检测试映射修复:
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实现并通过。
关键代码讲解
-
scripts/release_multi_surface_preflight.py(_check_desktop、_check_notes、build_parser、run_preflight)_check_desktop(L322-L388)不仅校验v<ver>与desktop-stableRelease 资产名,还会下载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 Releasev<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无本地绝对路径。
-
packages/dsh-loopx-plugin/scripts/verify-distribution.mjs&packages/dsh-loopx-plugin/smoke/dsh-registry-smoke.mjsverify-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 / 劫持 / 摘要不匹配的负向断言。
-
.github/workflows/dsh-plugin-publish.yml&packages/dsh-loopx-plugin/README.md- 在下载阶段探测
DSH_NPM_PACKAGE_MISSING与DSH_NPM_STAGING_PLACEHOLDER,发布失败时输出含auth-and-writes2FA 首包引导、blank Environment name与Allow npm publish checked的结构化::error提示;末步刷新origin/main的verify-distribution.mjs进行只读校验。
- 在下载阶段探测
-
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 triggerrelease-artifacts.ymlanddesktop-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 npmjsmaintainer:回退与延迟索引轮询及 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.
Delivery Brief
coreCLI/PyPI/origin/stable,desktopApp/Tauri updater/signing,dshplugin/npm/awesome-dsh-plugin, and bilingual release notes + Feishu guide) following thev2.4.0release and first-time npmjs OIDC Trusted Publisher onboarding fordsh-loopx-plugin.packages/dsh-loopx-plugin/scripts/verify-distribution.mjsqueried/-/v1/search?text=repository:..., which npmjs does not restrict by repository; low-scoring0.x/prerelease packages fell past rank 250 despite live npm publication..github/workflows/dsh-plugin-publish.ymllacked clear diagnosis for the npmjs first-publish HTTP404OIDC catch-22 andAllow npm publishpermission requirement, and previously ran tag-pinnedverify-distribution.mjsrather than the latest verifier frommain.scripts/qualify_release_commit.pystripped the leading dot from.github/paths vialstrip("./")before workflow preflight selection.scripts/release_multi_surface_preflight.py: Reuses existing static release metadata and desktop artifact owners to provideloopx_multi_surface_release_preflight_v1offline 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: Addsmaintainer:<username>search queries derived from published registry metadata plus--search-timeout-msretry while preservingdsh-pluginanti-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 structuredDSH_NPM_PACKAGE_MISSING/DSH_NPM_STAGING_PLACEHOLDERerrors, refreshesverify-distribution.mjsfromorigin/mainfor existing immutable tags, and documents the staged Multi-Surface Release Execution Pipeline (Stages 0–4).scripts/qualify_release_commit.py: Replaceslstrip("./")with_normalize_rel_path, appliesnorecursedirsonly 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: passedtests/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 passedruff check&mypy --follow-imports=silenton changed Python scripts/tests: passedscripts/release_multi_surface_preflight.py --require-clean --format json&--online --require-published --format json(againstv2.4.0&[email protected]):ok: true,published_complete: truepackages/dsh-loopx-plugin/smoke/dsh-registry-smoke.mjs --tarball <v0.1.1-beta.7.tgz>(pnpm10.33.0): passed includingmaintainer:fallback and negative checksloopx change-quality verify(cqr_2a54658b33d925a254f7, exact head0dadc8463a69e13eb3cdd8e05aeb6a61d14e320b) &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)