DSH / Atlas
2026-09-07implementedprocessarchived 2026-09-30

Selective Issue policy evaluation

Issue 策略的选择性求值

Informational Issue references provide context, while resolving references carry a Priority obligation. Requiring Project access for both makes unrelated board configuration or App availability block context-only PRs. Looking up referenced Issues before determining enforcement eligibility also spends credentials and API requests on PRs that cannot fail policy. Lifecycle events have a separate cost: an approval, comme

English

Problem

Informational Issue references provide context, while resolving references carry a Priority obligation. Requiring Project access for both makes unrelated board configuration or App availability block context-only PRs. Looking up referenced Issues before determining enforcement eligibility also spends credentials and API requests on PRs that cannot fail policy.

Lifecycle events have a separate cost: an approval, comment, push, label change, or assignment change need not perform a Project status handoff. Allocating a runner for a known no-op consumes capacity without changing the Issue.

Decision

Issue policy keeps its required job and trusted default-branch implementation. Enforcement eligibility precedes reference reads and Project App token creation: draft PRs, Bot/App authors, and human PRs with neither review requests nor submitted reviews do not require policy validation.

The workflow checks the trusted checkout for a selective-preflight capability marker before invoking the command. A checkout without the marker uses full legacy validation for human PRs and preserves the legacy Bot/App exemption. This supports PR workflow YAML running against default-branch code that lacks preflight; execution errors never select the fallback.

Eligible PRs resolve references through repository REST reads. Informational references prove Issue identity without Project access. Only actual Issues named by resolving references require Project Priority reads; a PR number cannot satisfy the Issue requirement or cause a Project query. The owner reference defines metadata validation and failure behavior.

Issue lifecycle subscribes to status-relevant PR events and filters title-only edits. It does not subscribe to PR pushes or label changes, or Issue assignment changes. Its job condition rejects approved/commented reviews before runner allocation. Changes-requested reviews retain their status command.

This scheduling decision partially supersedes the no-op-job scheduling in event-directed review status, not its handoff semantics or human-ownership protection. Project-local planning fields still own opened-only, empty-only Start Date initialization for every referenced Issue, including informational references. The validation read exemption does not exempt that lifecycle mutation.

Alternatives considered

Read every referenced Issue's Project fields. Informational references do not constrain Priority, so these queries add failure dependencies without contributing a validation result.

Keep successful no-op lifecycle jobs for approvals and comments. That preserves a green job presentation but allocates a runner for an event with no lifecycle command. Lifecycle is separate from the retained required policy job.

Remove the required policy job or redesign check authority. Selective reads and lifecycle scheduling can reduce avoidable work without changing which required check GitHub expects. Check-authority redesign is not part of this decision.

Consequences

Informational-only validation needs repository access but not Project credentials. Resolving validation still fails when required Project reads or field checks fail. Preflight and final validation each read live REST state, duplicating repository requests rather than caching a verdict. Avoiding Project reads and token creation does not guarantee fewer total API requests. The required policy job still allocates a runner; this is not a zero-cost required check.

Maintainers manually manage the Project custom Priority field. Native Issue-field skill guidance does not update that value. There is no Priority synchronization, field migration, or change to presentation-neutral policy.

Omitted lifecycle events cannot repair stale Project state. Event replay and concurrent writes retain the races documented by the lifecycle and planning-field owners. Actual Actions-minute savings and live GitHub App access require operational observation, not inference from a mocked API test.

Verification

Policy tests verify early exemptions, REST-only informational references, actual-Issue filtering, resolving Priority reads and failures, and the lifecycle command selection. Workflow tests verify Project-token conditions, the retained required job, pruned subscriptions, and runner-level lifecycle filtering. Local fixtures do not establish live webhook delivery or billing outcomes.

中文

问题

信息型 Issue 引用提供背景,解决型引用则带有 Priority 义务。两者都要求 Project 访问,会让无关的看板配置或 App 可用性阻止仅提供背景的 PR(Pull Request)。在确定强制范围之前读取被引用 Issue,也会为不可能因策略而失败的 PR 消耗凭据与 API 请求。

生命周期事件有独立成本:批准、评论、推送、标签变更或指派变更不一定需要执行 Project 状态交接。为已知无操作的事件分配 runner,会占用容量而不改变 Issue。

决策

Issue policy保留必需 job 与受信任的默认分支实现。强制范围判定先于引用读取与 Project App token 创建:草稿 PR、Bot/App 作者,以及既无评审请求也无已提交评审的人类 PR 均不需要策略校验。

工作流在调用命令前检查受信任检出中的选择性预检能力标记。缺少标记的检出对人类 PR 执行完整旧版校验,并保留旧版 Bot/App 豁免。这支持 PR 工作流 YAML 与缺少预检功能的默认分支代码配合执行;执行错误不会触发回退。

强制范围内的 PR 通过仓库 REST 读取解析引用。信息型引用无需 Project 访问即可证明 Issue 身份。只有解决型引用指向的实际 Issue 需要读取 Project Priority;PR 编号既不能满足 Issue 引用要求,也不会引发 Project 查询。所属参考文档定义元数据校验与失败行为。

Issue lifecycle订阅与状态相关的 PR 事件,并过滤仅标题编辑。它不订阅 PR 推送、PR 标签变更或 Issue 指派变更。job 条件在 runner 分配前排除 approved/commented 评审。请求修改的评审保留其状态命令。

本调度决策部分取代事件驱动评审状态中无操作 job 的调度方式,但不取代交接语义或人工状态归属保护。Project 局部规划字段仍拥有对每个被引用 Issue(包括信息型引用)仅在 PR 打开时、仅对空值初始化 Start Date 的规则。校验读取豁免不豁免该生命周期 mutation。

考虑过的替代方案

读取每个被引用 Issue 的 Project 字段。 信息型引用不约束 Priority,因此这些查询只增加失败依赖,不贡献校验结果。

为批准与评论保留成功的无操作生命周期 job。 这可以保持绿色 job 展示,却会为没有生命周期命令的事件分配 runner。生命周期与保留的必需策略 job 相互独立。

删除必需策略 job 或重新设计检查权威来源。 选择性读取和生命周期调度可以减少可避免的工作,无需改变 GitHub 期待的必需检查。检查权威来源的重新设计不属于本决策。

影响

仅含信息型引用的校验需要仓库访问,但不需要 Project 凭据。解决型校验在所需 Project 读取或字段检查失败时仍会失败。预检与最终校验各自读取实时 REST 状态,重复仓库请求而不缓存结论。避免 Project 读取与 token 创建不保证减少 API 请求总数。必需策略 job 仍分配 runner;它并非零成本的必需检查。

维护者手动管理 Project 自定义 Priority 字段。原生 Issue 字段的 skill 指引不会更新该值。不提供 Priority 同步或字段迁移,也不改变不检查展示形式的策略。

被省略的生命周期事件不能修复过时的 Project 状态。事件重放和并发写入仍有生命周期与规划字段文档记录的竞态。实际 Actions 分钟节省与 GitHub App 实际访问权限需要运营观察,不能从模拟 API 测试推断。

验证

策略测试验证早期豁免、仅使用 REST 的信息型引用、实际 Issue 过滤、解决型 Priority 读取及失败,以及生命周期命令选择。工作流测试验证 Project token 条件、保留的必需 job、精简后的订阅及 runner 级生命周期过滤。本地 fixture 不能证明实际 webhook 交付或计费结果。