Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

UK staging lease (4 h) is shorter than the qualify job's 330-minute limit

未关闭
#662 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
58/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
backend, testing

调研方向

Read stage_attempt and attempt_is_recoverable in src/policyengine/provenance/uk_qualification.py, then inspect the recovery cases in tests/test_uk_qualification_pipeline.py. Update the lease to at least six hours, preferably as a named constant tied to the qualify timeout, and adjust the listed expiry tests, including the 10:00 → 14:00 assertion. Done means a live attempt remains recoverable throughout the 330-minute qualify limit and the recovery tests reflect the new lease.

由索引模型根据 Issue 内容生成。

描述

Found in the independent review of #660.

stage_attempt writes expires_at = staged + timedelta(hours=4) (src/policyengine/provenance/uk_qualification.py, about line 1102). attempt_is_recoverable treats an expired attempt as abandoned even while its owner run is live, unless replay/request.json exists, and qualify writes that file only after the gates finish. The lease dates from when qualify had 120 minutes, so it was twice the limit. #660 raises qualify to 330 minutes, which makes the lease shorter than the limit.

Effect: if the gates ever run between about 240 and 330 minutes, the next catch-up re-stages a live attempt. That force-pushes a new candidate commit, un-readies the PR and queues a duplicate qualification. It's churn, not a deadlock. Today's gates are projected at about 140 minutes, so this doesn't trigger now.

Fix: raise the lease to at least 6 hours, ideally as a named constant tied to the qualify timeout. Update the 15 recovery tests in tests/test_uk_qualification_pipeline.py that stage at T and evaluate expiry at T+4–5 h (e.g. test_newer_abandoned_stage_recovers_despite_an_older_replay_request, test_forced_stage_recovery_binds_the_terminal_receipt_it_supersedes[*], test_resolution_preserves_authorization_to_recover_forced_work[expired-*], test_runs_resolved_on_different_main_commits_never_both_stage, test_cross_base_recovery_allocates_new_keys_without_overwriting_evidence), plus test_stage_records_owner_and_expiry_immutably, which pins 10:00 → 14:00.

主要语言
Python
星标
8
派生
10
平均合并
23 小时 16 分钟
30 天内合并 PR
49

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PolicyEngine/policyengine.py 的其他 Issue

查看 PolicyEngine/policyengine.py 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。