Repository navigation
fix: T6 可达性补洞——guard 对齐 owner∪agent + 三元组 run_id 标签路径回退(ADR-0085) #404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -389,6 +389,21 @@ jobs: | |
| if payload: | ||
| run_id = (payload.get("client_payload") or {}).get("run_id") or payload.get("run_id") | ||
| verdict_from_dispatch = (payload.get("client_payload") or {}).get("verdict") | ||
| if not run_id: | ||
| # 标签路径补件(ADR-0085,IR-0006 W1 实走发现 2026-08-29): | ||
| # label:state:wave-planned 事件无 dispatch 载荷——run_id 从本卡 | ||
| # survived 评论机械提取(评论须含 verdict=survived/adversary:survived | ||
| # 且带 run_id 键,与下方跨卡复用检查同源同则);提取不到仍 | ||
| # fail-closed 拒绝("缺少审计 run ID") | ||
| st_c2, cs = api(E["APP_TOKEN"], f"/repos/{REPO}/issues/{issue_number}/comments") | ||
| if st_c2 == 200: | ||
| for c in cs or []: | ||
|
Comment on lines
+398
to
+400
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Comment pagination rejects evidence Both fallback scans call the comments endpoint once without pagination, so GitHub returns only the first 30 comments in ascending order and a valid survived record after comment 30 is invisible. On such issues the label path is denied for missing run_id, while an old survived-looking record in the first page may be selected instead of the current one. Agent Prompt
|
||
| cb = c.get("body", "") | ||
| if "adversary:survived" in cb or "verdict=survived" in cb: | ||
| m_run0 = re.search(r"run[_-]?id[=:]\s*([A-Za-z0-9_\-]+)", cb, re.I) | ||
| if m_run0: | ||
| run_id = m_run0.group(1) | ||
|
Comment on lines
+402
to
+405
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Untrusted comments bypass gate The fallback accepts any comment containing a survived substring and a run-like token, then the existing check merely rediscovers that same token on the same issue; it never verifies the comment author, the Actions run, or any binding to card_id, specVersion, or the current lifecycle. Thus a stale or user-authored comment such as adversary:survived run_id=fake can satisfy T6 once an owner applies the transition label, despite the transition contract forbidding historical/cross-card evidence. Agent Prompt
Comment on lines
+402
to
+405
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift Major:不要把任意 issue 评论当作权威审计记录。 此分支按评论正文的子串和首个正则匹配直接设置 请改为校验不可变且可追溯的审计记录,并将 card、 As per coding guidelines:append-only 账本要求用量/生命周期/分诊/fan-out 产物只增不改,并使用 ADR-0062 hash 链。 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| break | ||
| # 三元组完整性检查 | ||
| if not spec_version: | ||
| return False, "缺少 specVersion(issue body 未含 specVersion 字段)", None | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: Cloudbird-Software/.github
Length of output: 17267
🏁 Script executed:
Repository: Cloudbird-Software/.github
Length of output: 6368
🌐 Web query:
GitHub REST API list issue comments default pagination per_page page Link header💡 Result:
For the GitHub REST API endpoint to list issue comments, the default pagination settings are as follows: - per_page: The default number of results returned per page is 30, with a maximum limit of 100 [1][2][3]. - page: The default page number is 1 [1][2][3]. When an API response is paginated, GitHub includes a Link header in the HTTP response [4][5]. This header provides URLs that you can use to navigate between pages of results [5][6]. It contains links for the following relations [5][6]: - rel="prev": The URL for the previous page. - rel="next": The URL for the next page. - rel="last": The URL for the final page of results. - rel="first": The URL for the first page of results. If an endpoint does not support pagination, or if all results fit on a single page, the Link header is omitted from the response [5][7].
Citations:
为 T6 的 issue comments 查询实现分页。
check_triple_survived请求/repos/{REPO}/issues/{issue_number}/comments时未设置分页参数。GitHub 默认每页返回 30 条;api也未保留Link响应头。当符合解析规则的survived评论位于后续页面时,T6 会找不到run_id并错误地 fail-closed。后续跨卡复用检查同样只读取第一页,也可能错误拒绝合法的run_id。请读取全部分页结果,并增加跨页测试。🤖 Prompt for AI Agents