Skip to content

feat(pm): H82 reads claimed card PRs CI cannot see; post-stamped refuses a lone Claim: comment - #36434

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-36203-half-state-and-claim-refusal
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-36203-half-state-and-claim-refusal

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #36203

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户无感:这是车队内部工具。巡查脚本现在会标出"已认领卡的草稿 PR 有冲突,或推上去后 CI 根本没跑";发评论的工具不再接受单独发出的认领评论,会提示改用连标签一起改的一笔写法。
  • 属于"派发为什么会出现疏漏"那张卡的最后两条脚本项(技能文字五条已合入),替席位和卡线程解决"互相等 CI、其实 CI 根本没开跑"的问题。
  • 出错最坏是巡查报告多一行或少一行提醒,或某条认领评论被拒、换一种写法重发;不改任何数据,可以直接撤回。
  • 无

What changes

Items 6 and 7 of the card's To do (items 1-5, the skill text, merged in #36205). Script-only: scripts/pm/check-half-states.mjs and scripts/pm/post-stamped.mjs, each with its self-test battery. No skill text, no ceiling, no workflow.

Item 6 — new row H82 in the half-state patrol: a claimed card's PR that CI cannot see. The release note offered "widen H12/H16 to claimed drafts, or a new row"; this takes the new row. H16's pinned non-draft scope stays true for every other PR, H12 (orphan landing of a ready PR) has no meaning on a draft, and the second signal the card asks for (no Actions ever ran) is a read neither row makes.

  • Population: an open PR whose body binds (closing keyword or Part of, H16's extractor) a card the sweep holds under pm:dispatched — the state model's claimed bit, free from the label pages the sweep already lists. Silent past 30 min by updated_at (H16's age proxy), the card-thread wake rule's own number (dispatch-runbook.md, 卡线程: 推后 30 分钟零 Actions、dirty).
  • Leg 1: a DRAFT with mergeable_state: dirty. A non-draft dirty PR stays H16's row alone, never reported twice.
  • Leg 2: any claimed PR, draft or ready, not dirty, whose head answers total_count: 0 on /commits/SHA/check-suites?app_id=15368 (the GitHub Actions app). The filter is load-bearing: measured on the incident head 473c7ff4 (PR feat(spec): relatedLists is the record page's tab list, with built-in tabs by object name and per-entry title and columns #35923), the unfiltered read answers 5 suites (deploy previews, the fleet app) and the Actions-filtered one 0; a head CI ran on answers 10 Actions suites of 15.
  • Reads: the PR row (reused from H16's pass when both want it) and one check-suites page, for candidates only. A failed PR-row read drops that PR, all-failed rethrows (H16's posture). A failed check-suites read is UNJUDGED, counted on the summary line, never a zero and never rethrown.
  • Registered as a stall band row, four count keys on the sweep contract, one summary clause (Claimed card PRs (H82): …) with its anchor.

Item 7 — post-stamped.mjs refuses a comment whose first keyed line is Claim: (exit 2, zero writes). The first line after the signature is read through the patrol's own marker (CLAIM_COMMENT_MARKER, markerMatches, so > Claim: counts as it does for H2). The refusal prints the stroke that folds the same comment: label-write.mjs --issue N --comment-file PATH --add pm:dispatched --remove pm:queue --assign LOGIN.

  • Judged in main after the route is resolved, deliberately NOT in judgeBody: judgeBody is the path label-write --comment-file folds the comment through, and that fold is the remedy.
  • One arm is route-aware. label-write's header says --comment-file is RELAY-ONLY and that on a route resolved direct the claim goes "through post-stamped and the labels here, as before". Refusing there would leave no claim route at all, so on direct the claim is still written, with a stderr note that the labels follow as a second write. Every other route refuses, an undecidable one included (it cannot prove the fold absent).

Tests

Self-tests, at the head that also ran the gates (6efbcf5)
  • pnpm check:pm-half-states: exit 0, check-half-states self-test: 5420 cases pass, battery H82 claimed card PR CI cannot see 24/24 (pin at the count). Each leg's firing case sits beside the control that silences it: the dirty draft vs. the same draft clean; H16 silent on the dirty draft H82 fires on; zero suites vs. an unread (null) reading; a non-draft dirty PR left to H16 while H16 does fire on it; unclaimed vs. claimed; the 30-minute boundary; the gate never narrower than the predicate; band, summary pair, count keys, wiring.
  • pnpm check:pm-post-stamped: exit 0, post-stamped self-test: 802 cases pass across 30 batteries (787 / 29 before). New battery, 15 cases: refused on the relay route and on an undecidable one; the direct control; a Claim: quoted further down a round report, a card body and a non-claim comment pass; the refusal text; control: the same claim through judgeBody (label-write's fold path) passes; CLI dry runs (refused exit 2 off direct, rendered exit 0 on direct, a non-claim body exit 0 on the same route); structural placement.
  • pnpm check:pm-label-write: exit 0, 398 cases pass across 19 batteries (its fold battery folds a signed Claim: through judgeBody).
Live reads (read-only, this container)
  • Live patrol sweep (node scripts/pm/check-half-states.mjs, no flags, report-only, writes nothing): Claimed card PRs (H82): PR row read on 15 of 15 open PR(s) bound to a pm:dispatched card and silent past 30 min, and the Actions check suites read on 15 of 15 head(s) not in conflict. No H82 row today: no claimed card PR on the board is currently blind.
  • post-stamped.mjs --dry-run --comment=36203 with a signed claim: route dispatch, exit 2, the refusal naming the fold stroke.
  • label-write.mjs --issue 36203 --add pm:dispatched --comment-file SAME --dry-run: exit 0, packed as ONE relay dispatch with the comment, nothing sent.

Acceptance notes

  • Third wake trigger not read. The runbook's third trigger (2 h with no push and no report) is still read by nobody mechanically; seat 1's release note names item 6 as the place to close it. This PR reads only the two signals the dispatch names (dirty, zero Actions suites).
  • The patrol workflow grants no checks: scope. half-state-patrol.yml lists contents, issues, pull-requests. If its GITHUB_TOKEN cannot read check suites, the runner's leg 2 reads UNJUDGED (said on the summary line) and leg 1 still runs. Not measured on a runner, because the workflow is on demand only. The seat-container sweep, the live consumer, reads them (15 of 15 above).
  • Population is the label, not the claim comment. "Claimed" is a bound card under pm:dispatched. A label without its claim is H1/H2's row, and re-reading every bound card's thread would cost requests.
  • Age proxy. updated_at, as H16. A quiet PR whose base just moved flags at once. A comment on the PR defers the row by one threshold.

Verification

  • Targeted gates (dispatch-gates --commands, 70 families, at 6efbcf556bd): 68 exit 0. --ran reconciliation: 70 derived, 69 run, 1 NOT-MEASURED. NOT MEASURED, pnpm check:i18n-coverage, exit 3: prerequisite not met (no package dist/ built, and the diff touches no package). Red locally but NOT MEASURED, node scripts/check-self-test-workflow-commands.mjs: an unrelated child self-test (check-adr-0087-registration.mjs --self-test) runs past its 120 s spawn budget on the shared box (measured 3 min 1 s standalone, exit 0). CI owns both.
  • overlap-check.mjs: clean against origin/main, 0 PR heads.

Read first: check-half-states.mjs, the H82 sweep pass after H16's rethrow (the two read postures). h82ClaimedPrBlind (the leg split with H16). post-stamped.mjs, main's claimStrokeRefusal call and its direct arm.

Two-minute check: node scripts/pm/post-stamped.mjs --self-test 2>&1 | grep "claim stroke\|refuses the claim" lists the claim-stroke cases, every one ✓.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jTeURPvEm465RcoYEC

@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 22, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 ACCEPT · head 6efbcf556bd42e43ba720da713cc39e69b757f8a · 2026-11-22T11:43Z

维护者速读

席位问的两件事

  1. direct 路由那一支(认领仍然写出,stderr 加一句说明):接受。 label-write.mjs 的文件头(第 181 行)写明 --comment-file 是 RELAY-ONLY:路由解析为 direct 时 exit 3、零写入,并要求「send the comment through post-stamped and the labels here, as before」。在 direct 上要是也拒,就没有任何地方能发认领了,这和 label-write 自己写下的退路相矛盾。这一支只放过「解析结果确实是 direct」这一种情况;路由判不出来时照样拒,因为它证明不了 fold 不存在。自测给两边各钉了一条对照。还有一个边角:auto 下正文超过 20 KB 会改走 direct(sizeRoute),认领也就跟着单独写出;但在那条路上 fold 一样走不通,所以结论不变。
  2. 巡查 workflow 缺 checks 权限:是的,runner 上零 Actions 那一支会读成 UNJUDGED。 half-state-patrol.yml:229-232 只给了 contents: read、issues: write、pull-requests: read;/commits/SHA/check-suites 要 checks: read。所以 runner 上每个 head 都会被 catch 成 null,摘要行写成「read on 0 of N head(s) — UNJUDGED」,不会凭空报一个零,冲突那一支照常跑。不改判的理由有三条:这个 workflow 没有定时,只按需触发;真正每轮用它的是席位在容器里跑的扫描(execution-duties.md:17 写的就是「本地 node scripts/pm/check-half-states.mjs」),正文实测那里读到了 15/15;.github/workflows/** 是受管面(check-governed-merges 的 workflows 行,Tier H),补这一行会让本 PR 变成受管 PR。范围外候选:一张单独的 Tier H 卡,给 half-state-patrol.yml 加 checks: read,改完在 runner 上实测一次。要不要立卡,由席位决定。

席位核对

  • 形态:draft、base main、Fixes #36203;NOT governed;2 个文件,+374 −1;挂 skip-changeset,只碰了不发布的 @objectstack/spec-monorepo,这是对的。Clause-②: no 和 Metadata-protocol: none 都属实:脚本只多报一行、多拒一种写法,不碰任何元数据面。Fixes 能成立:卡上的第 1-5 项已经在 fix(pm-dispatch): a hold is a Blocked-by line on the card, every patrol picks per card, and a card thread confirms CI started (#36203) #36205 合入,本 PR 是第 6、7 项;三条验收里,「一轮巡查内标出」和「--self-test 里有 Claim: 的拒绝」都在这里交付。正文写明「2 小时没推送也没报告」这第三个唤醒条件没有机械读数;它在 runbook 第 4 项里,本来就不是第 6 项要做的。
  • H82:人群是正文绑定的卡(复用 H16 的提取器)里、在 pm:dispatched 下的那些,按 updated_at 超过 30 分钟,门槛不会比判定窄(有自测钉住)。冲突那一支只报草稿,非草稿交给 H16,不会重复报。零 Actions 那一支按 app_id=15368 过滤:不过滤的话,别的 app 的 suite 会把缺口盖住,正文在事故 head 473c7ff4 上实测过(5 个 suite,里面 0 个是 Actions 的)。读不到时记 null = UNJUDGED,计进摘要行,不重新抛出;PR 行读失败沿用 H16 的姿态(单条丢掉,全部失败才抛出),和 H16 都要读的 PR 行只 GET 一次。band 是 stall,四个计数键和摘要锚点都登记了。
  • 认领拒绝:只读签名后的第一行,和 H2 用同一个 marker(> Claim: 也算);认领出现在报告下文里的不算。判断放在 main 里、路由解析之后、dry-run 退出之前,不放进 judgeBody,因为 label-write 的 fold 走的就是 judgeBody。我核过修正认领的情形:卡已经是 pm:dispatched 时,席位改认领用的也是 Claim: 开头(例如 7077058264)。这种评论现在会被拒,转给 label-write 那一笔;那一笔里标签全是 no-op,planned 仍为真,所以不会被「nothing to fold」拒掉,foldActions 照样带上评论。正文在 pm-dispatch: a held epic child and a waiting card thread leave a machine-readable mark, and the patrol reads it (two misses 2026-11-21) #36203(已经是 pm:dispatched)上做的 dry run 也说明这条路走得通。
  • 我自己跑的:按本地探查的做法,把两个文件 checkout 到主检出里,post-stamped.mjs --self-test 802 个用例 / 30 组全过,check-half-states.mjs --self-test 5420 个用例全过,其中 H82 24/24;跑完已经还原,git status 干净。
  • nit,不改判:(a) 拒绝文案里「the card stays pm:queue with no assignee」对修正认领不成立(那张卡早就派出去了),可以改成「may stay」;(b) 维护者速读第四条只写了「无」,少了「要你做什么:」这几个字。
  • CI @ 6efbcf55:32 success · 23 expected skip · 0 failed · 0 pending(含 Live half-state sweep);mergeable_state clean。
  • 落地条款:非受管,不到 3,000 行,由席位 ready + auto-merge;Fixes 合入后关卡。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Landing (seat 7, 2026-11-22T11:45Z): head 6efbcf556bd42e43ba720da713cc39e69b757f8a · L1 ACCEPT 7078641244 (L1-d; post-stamped 802 and half-states 5420 cases pass locally, H82 24/24) · no L2 face (Clause-②: no, Metadata-protocol: none, scripts/pm/** only, not governed) · check-governed-merges --pr 36434: NOT governed, 375 changed lines · CI on the head: all success. → pr_ready + automerge_enable (merge queue).
Accepted: post-stamped still writes a claim on the direct route, with a note, because label-write's fold is relay-only (label-write.mjs:181). Carried to a follow-up card: on the runner, H82's zero-Actions leg reads UNJUDGED because half-state-patrol.yml has no checks: read (a Tier H workflow edit), and the refusal text says "card stays pm:queue" even for a claim amendment.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 11:45
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit cd7ea2e Nov 22, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36203-half-state-and-claim-refusal branch November 22, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pm-dispatch: a held epic child and a waiting card thread leave a machine-readable mark, and the patrol reads it (two misses 2026-11-21)

2 participants