Skip to content

fix: 拒绝 BUILD_PROMPT 与 release.yml gitlink 漂移 - #450

Open
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/bc-2a724f55-1bab-48c9-be0c-cefc7f494829-fbbe
Open

cursor[bot] wants to merge 2 commits into
mainfrom
cursor/bc-2a724f55-1bab-48c9-be0c-cefc7f494829-fbbe

Conversation

@cursor

@cursor cursor Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

摘要

v1.8.7 已把 gitlink、README、DEPENDENCIES 与 release.yml 可复用工作流对齐到 dc4433d1,但 BUILD_PROMPT.md 标题仍写配方 0.3.20;昨日 #448 的 live-pin 门禁也未合入且已与 main 冲突。本 PR 在当前已发布固定点上补齐这两处,并记录 2026-11-12 Issue / 安全 / 冗余代码扫描。

改动

Issue 边界

本环境不能推送 magicnet-android,也不关闭上述 Issue。

本地验证

  • test-check-recipes.py 7 passed
  • test-release.py 16 passed
  • test-release-plan.py 37 passed
  • check-recipes.py 8 packages / 62 Markdown;live pin dc4433d1 / v1.8.7 10615
  • check-workflows.sh passed
Open in Web View Automation 

Sourcery 摘要

使配方元数据和发布工作流引用与已发布的源代码修订版本保持一致,并在验证检查中强制执行这一一致性。

错误修复:

  • 将 BUILD_PROMPT 配方版本与当前 0.3.21 版本的元数据同步。
  • 防止配方验证接受过时的源代码 gitlink、配方版本或可复用发布工作流固定版本。

增强功能:

  • 记录当前的 issue、安全性和冗余代码审查状态,包括已锁定的 zashboard 资源及尚待处理的 issue 范围。

文档:

  • 澄清经审查的 zashboard 版本已是锁定的默认面板,并根据当前发布状态更新验证和 issue 分类记录。

测试:

  • 扩展配方和发布计划测试,涵盖 BUILD_PROMPT gitlink/版本一致性以及可复用工作流固定版本验证。
Original summary in English

Sourcery 摘要

在整个验证和发布流程中,确保已发布的源代码修订版本、配方元数据和可复用的发布工作流保持一致。

Bug Fixes:

  • 将配方元数据和发布工作流引用同步到经过审核的 Android 源代码修订版本。
  • 在配方和发布验证期间,拒绝过期的 BUILD_PROMPT 源代码或配方固定版本,以及可复用工作流引用。
  • 除非先更新代码仓库中经过审核的固定版本,否则阻止发布其他源代码修订版本。

Enhancements:

  • 在发布前以及重试发布快照时重新验证源代码固定版本,以防止发生偏差。

Documentation:

  • 更新与经过审核的源代码及已锁定的仪表板资源相关的发布指南、验证记录、依赖元数据和问题跟踪信息。

Tests:

  • 扩展配方和发布计划测试,覆盖过期、格式错误、历史版本及其他源代码固定版本场景。
Original summary in English

Summary by Sourcery

Enforce consistency between the published source revision, recipe metadata, and reusable release workflows throughout validation and publishing.

Bug Fixes:

  • Synchronize the recipe metadata and release workflow references with the reviewed Android source revision.
  • Reject stale BUILD_PROMPT source or recipe pins and reusable workflow references during recipe and release validation.
  • Prevent publishing alternate source revisions unless the repository’s reviewed pins are updated first.

Enhancements:

  • Revalidate source pins before publishing and when retrying release snapshots to prevent drift.

Documentation:

  • Update release guidance, verification records, dependency metadata, and issue tracking for the reviewed source and locked dashboard asset.

Tests:

  • Expand recipe and release-plan coverage for stale, malformed, historical, and alternate source pin scenarios.

Keep the published dc4433d1 pin. Align the recipe title with 0.3.21 and record the 2026-11-12 issue, security, and dead-code sweep.

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

sourcery-ai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

审阅者指南

实现

添加共享的活动 pin 校验器,并确保发布快照和重试与已分派的 gitlink 及经过审阅的可复用工作流 pin 相匹配。

  • scripts/recipe_pins.py L1-58
  • scripts/release-plan.py L209-212, L219-224(+2 处小改动)

让配方校验调用共享检查,确保过期的 BUILD_PROMPT 源/版本字段或发布工作流 pin 无法通过校验。

  • scripts/check-recipes.py L12-13, L51

配置

将两个可复用的发布工作流固定到经过审阅的源提交,并明确发布时允许的源引用行为。

  • .github/workflows/release.yml L29, L147, L160

文档

更新配方的活动源 pin,并记录候选源的变更及其验证状态。

  • README.en.md L7
  • README.md L30
  • README.ru.md L7
  • recipes/magicnet/BUILD_PROMPT.md L1, L10
  • recipes/magicnet/DEPENDENCIES.md L22
  • recipes/magicnet/VERIFICATION.md L9-13, L169-175

记录发布必须使用经过审阅的 pin,并更新发布说明和问题分类备注,以反映当前工作流和扫描结果。

  • docs/releasing.md L31-35(+3 处小改动)
  • recipes/magicnet-module-delivery/EXTERNAL_ASSETS.md L12-13
  • recipes/magicnet-module-delivery/RELEASE_CONTRACT.md L10-11
  • recipes/magicnet/ISSUE_TRIAGE_2026-11-06.md L195-243

测试

添加回归测试,覆盖过期或格式错误的活动 pin、历史示例、工作流引用、备用发布源,以及无效或伪造的快照。

  • scripts/test-check-recipes.py L31-44, L54, L76-165
  • scripts/test-release-plan.py L157-171, L383-429(+3 处小改动)

锁定文件和 vendored 代码

将实现子模块 gitlink 更新到候选源提交。

  • generated/magicnet-android L1

提示和命令

与 Sourcery 互动

  • 触发新的审阅: 在拉取请求中评论 @sourcery-ai review。
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 根据审阅评论创建 GitHub issue: 回复某条审阅评论,请 Sourcery 根据该评论创建 issue。你也可以在审阅评论中回复 @sourcery-ai issue,根据该评论创建 issue。
  • 生成拉取请求标题: 在拉取请求标题的任意位置写入 @sourcery-ai,即可随时生成标题。你也可以在拉取请求中评论 @sourcery-ai title,随时重新生成标题。
  • 生成拉取请求摘要: 在拉取请求正文中所需位置写入 @sourcery-ai summary,即可在该位置随时生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary,随时重新生成摘要。
  • 生成审阅者指南: 在拉取请求中评论 @sourcery-ai guide,即可随时重新生成审阅者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已处理完所有评论且不想再看到它们,这个命令会很有用。
  • 关闭所有 Sourcery 审阅: 在拉取请求中评论 @sourcery-ai dismiss,即可关闭所有现有的 Sourcery 审阅。如果你想从头开始进行新的审阅,这尤其有用——别忘了评论 @sourcery-ai review 以触发新的审阅!

自定义使用体验

访问你的控制面板,即可:

  • 启用或禁用审阅功能,例如 Sourcery 生成的拉取请求摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、删除或编辑自定义审阅说明。
  • 调整其他审阅设置。

获取帮助

Original review guide in English

Reviewer's Guide

Implementation

Add a shared active-pin validator and enforce that publish snapshots and retries match the dispatched gitlink and reviewed reusable-workflow pins.

  • scripts/recipe_pins.py L1-58
  • scripts/release-plan.py L209-212, L219-224 (+2 small edits)

Make recipe validation invoke the shared check so stale BUILD_PROMPT source/version fields or release workflow pins fail validation.

  • scripts/check-recipes.py L12-13, L51

Configuration

Pin both reusable release workflows to the reviewed source commit and clarify the allowed source-ref behavior for publish.

  • .github/workflows/release.yml L29, L147, L160

Documentation

Update the recipe’s active source pin and document the candidate source’s changes and verification status.

  • README.en.md L7
  • README.md L30
  • README.ru.md L7
  • recipes/magicnet/BUILD_PROMPT.md L1, L10
  • recipes/magicnet/DEPENDENCIES.md L22
  • recipes/magicnet/VERIFICATION.md L9-13, L169-175

Document publish’s reviewed-pin requirement and update release instructions and issue-triage notes to reflect the current workflow and scan findings.

  • docs/releasing.md L31-35 (+3 small edits)
  • recipes/magicnet-module-delivery/EXTERNAL_ASSETS.md L12-13
  • recipes/magicnet-module-delivery/RELEASE_CONTRACT.md L10-11
  • recipes/magicnet/ISSUE_TRIAGE_2026-11-06.md L195-243

Tests

Add regression coverage for stale or malformed active pins, historical examples, workflow references, alternate publish sources, and invalid or forged snapshots.

  • scripts/test-check-recipes.py L31-44, L54, L76-165
  • scripts/test-release-plan.py L157-171, L383-429 (+3 small edits)

Lock files and vendored code

Advance the implementation submodule gitlink to the candidate source commit.

  • generated/magicnet-android L1

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai 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.

你好——我发现了 2 个问题

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="scripts/check-recipes.py" line_range="51" />
<code_context>
         raise ValueError("DEPENDENCIES.md does not record the current source gitlink")
     if gitlink not in readme:
         raise ValueError("README.md does not record the current source gitlink")
+    if gitlink not in prompt:
+        raise ValueError("BUILD_PROMPT.md does not record the current source gitlink")
+    for workflow_name in ("exec.yml", "android-kernelsu-acceptance.yml"):
</code_context>
<issue_to_address>
**Stale pins pass validation**

When a stale active prompt or workflow value coexists with the expected value elsewhere, `verify_live_pins` uses substring checks for the prompt and workflow, so the stale title or active `uses` ref passes and the release gate reports valid pins.

Parse the active prompt version and reusable-workflow `uses` refs, then compare each exact value with the current recipe version or gitlink.

Also at `scripts/check-recipes.py:55-57`, `scripts/check-recipes.py:65-66`.
</issue_to_address>

### Comment 2
<location path="scripts/check-recipes.py" line_range="51-52" />
<code_context>
         raise ValueError("DEPENDENCIES.md does not record the current source gitlink")
     if gitlink not in readme:
         raise ValueError("README.md does not record the current source gitlink")
+    if gitlink not in prompt:
+        raise ValueError("BUILD_PROMPT.md does not record the current source gitlink")
+    for workflow_name in ("exec.yml", "android-kernelsu-acceptance.yml"):
+        pin = f"LIghtJUNction/magicnet-android/.github/workflows/{workflow_name}@{gitlink}"
</code_context>
<issue_to_address>
**Release snapshots bypass pin checks**

When a release selects a `source_ref` different from the checked-in gitlink, the release action checks pins before `prepare` selects `source_ref`; `prepare` then writes the selected SHA into the snapshot gitlink without updating BUILD_PROMPT or `release.yml`. A release using a different source ref therefore produces a recipe snapshot whose documented pins disagree with its gitlink, despite the new gate.

Validate the finalized release snapshot against the pin contract, or prevent alternate-source snapshots unless their associated pin fields can be kept consistent.

Also at `scripts/check-recipes.py:53-58`.
</issue_to_address>

Sourcery 评估

待批准。 请先处理 2 项发现。

阻塞性发现:scripts/check-recipes.py:51、scripts/check-recipes.py:52


Sourcery 对开源项目免费——如果你喜欢我们的评审,请考虑分享 ✨
Original comment in English

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="scripts/check-recipes.py" line_range="51" />
<code_context>
         raise ValueError("DEPENDENCIES.md does not record the current source gitlink")
     if gitlink not in readme:
         raise ValueError("README.md does not record the current source gitlink")
+    if gitlink not in prompt:
+        raise ValueError("BUILD_PROMPT.md does not record the current source gitlink")
+    for workflow_name in ("exec.yml", "android-kernelsu-acceptance.yml"):
</code_context>
<issue_to_address>
**Stale pins pass validation**

When a stale active prompt or workflow value coexists with the expected value elsewhere, `verify_live_pins` uses substring checks for the prompt and workflow, so the stale title or active `uses` ref passes and the release gate reports valid pins.

Parse the active prompt version and reusable-workflow `uses` refs, then compare each exact value with the current recipe version or gitlink.

Also at `scripts/check-recipes.py:55-57`, `scripts/check-recipes.py:65-66`.
</issue_to_address>

### Comment 2
<location path="scripts/check-recipes.py" line_range="51-52" />
<code_context>
         raise ValueError("DEPENDENCIES.md does not record the current source gitlink")
     if gitlink not in readme:
         raise ValueError("README.md does not record the current source gitlink")
+    if gitlink not in prompt:
+        raise ValueError("BUILD_PROMPT.md does not record the current source gitlink")
+    for workflow_name in ("exec.yml", "android-kernelsu-acceptance.yml"):
+        pin = f"LIghtJUNction/magicnet-android/.github/workflows/{workflow_name}@{gitlink}"
</code_context>
<issue_to_address>
**Release snapshots bypass pin checks**

When a release selects a `source_ref` different from the checked-in gitlink, the release action checks pins before `prepare` selects `source_ref`; `prepare` then writes the selected SHA into the snapshot gitlink without updating BUILD_PROMPT or `release.yml`. A release using a different source ref therefore produces a recipe snapshot whose documented pins disagree with its gitlink, despite the new gate.

Validate the finalized release snapshot against the pin contract, or prevent alternate-source snapshots unless their associated pin fields can be kept consistent.

Also at `scripts/check-recipes.py:53-58`.
</issue_to_address>

Sourcery assessment

Approval pending. 2 findings to address first.

Blocking findings: scripts/check-recipes.py:51, scripts/check-recipes.py:52


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread scripts/check-recipes.py Resolved
Comment thread scripts/check-recipes.py Resolved

Copy link
Copy Markdown
Owner

已在 6e7f8ca 更新本 PR。

  • scripts/recipe_pins.py 对活动 BUILD_PROMPT 标题、源码声明及 build/android job 的直接 uses 字段做精确校验;代码块、注释与历史示例不作为活动记录。
  • release-plan.py 在快照推送前及同 run 恢复时校验固定值。publish 的来源必须与已审核的配方 gitlink 一致;build/verify 仍允许选择 source_ref。操作约束已同步到发布说明与合同。
  • 源码候选见 magicnet-android #6,pin 为 eca9ac8:保留全部 supervisor 停止身份检查,增加有界固定枚举诊断;长 JSON 的逐键输入独立使用 15 秒预算,原断言不变。这还不是 Android stop-cleanup 根因已解决的证明。

本地验证:15 项 pin、41 项发布计划、16 项资产回归通过;recipkg check/pack/归档检查/build(8 包、62 Markdown)、actionlint、diff-check 通过。新 head 的完整预览 CI已排队,Android 与浏览器最终结果尚待复验;未合并、未发布。

Copy link
Copy Markdown
Owner

精确 head 6e7f8ca10fee67f452dbc304b57e8cbcb883e729 的完整预览 CI现已通过:构建与 release quality gate(含实际运行 528 秒、exit 0 的 webui-browser)、Android 15 / KernelSU lifecycle、mandatory evidence、独立 Android Simulation Gate 及 Verify release assets 全部成功;recipe checks也通过。publication/publish 按预期跳过,没有发布。

两项原 inline finding 已由精确 pin 校验和最终快照/重试校验修复并关闭线程。独立复审再次确认源码诊断白名单及停止身份验证未被弱化。

边界:本次 Android 完整通过不等于此前间歇性 supervisor_marker 故障根因已消除。源码补丁增加的是可定位诊断,尚不能宣称修复该竞态;正在检查独立复验结果。未合并。

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.

2 participants