From cbdd979f6ab19e3363f8c83b046e5327f7c05297 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Nov 2026 05:30:12 +0000 Subject: [PATCH 1/8] wip(pm-dispatch): blocking mechanism rule text, partial hand-off Rule text for the blocking-mechanism card is written in the pm-dispatch skill, os-dev.md and docs/NORTH-STAR.md. This is a hand-off checkpoint, not a finished commit. Not done on this branch yet: - scripts/pm/check-half-states.mjs is untouched (retire the two pm:blocking cache rows, add the new blocking and decision rows with self-tests) - scripts/pm/ensure-pm-labels.sh still creates pm:blocking - scripts/pm/check-skill-line-ratchet.mjs ceilings are not moved, so the ratchet is red on state-machine.md (50 vs 43), filing-gate.md (86 vs 82), decision-analysis.md (50 vs 49) and os-dev.md (407 vs 405); execution-duties.md dropped to 189 and its row can be lowered - the maintainer-brief card and the skill-conflict card have no commit Claude-Session: https://claude.ai/code/session_01JQwxbWgJ5moPK9gRk4ufqV Co-authored-by: Claude --- .claude/agents/os-dev.md | 2 ++ .claude/skills/pm-dispatch/SKILL.md | 20 +++++++++---------- .../pm-dispatch/references/coordinator.md | 4 ++-- .../references/decision-analysis.md | 3 ++- .../references/dispatch-runbook.md | 2 +- .../references/execution-duties.md | 1 - .../pm-dispatch/references/filing-gate.md | 10 +++++++--- .../pm-dispatch/references/lanes/director.md | 2 +- .../pm-dispatch/references/state-machine.md | 9 ++++++++- .../pm-dispatch/references/triage-duties.md | 4 ++-- docs/NORTH-STAR.md | 4 ++-- 11 files changed, 37 insertions(+), 24 deletions(-) diff --git a/.claude/agents/os-dev.md b/.claude/agents/os-dev.md index 20c8144ba2f..78994eecb47 100644 --- a/.claude/agents/os-dev.md +++ b/.claude/agents/os-dev.md @@ -352,10 +352,12 @@ model: opus - 同 PR 改,正文点名裁决 id,落地欠达档 L2 记录;⛔ 永不自行翻转裁决,与之相左仍停手。 - 两种读法通向两种架构时同此;⛔ 不写投机代码。 - 返回 `status: "needs_decision"`,每个问题带选项、真实代价与工作量、推荐,写进 `open_questions`。 +- 需维护者裁的事 dev ⛔ 不直接问他:报 `needs_decision`,席位转天花板档决策线程。 - 派发词标只读读数 ⇒ 不 commit、不开 PR,`status: "reading"` 贴决策卡;要实测才建闭包跑测。 - 框架唯一副本在 pm-dispatch SKILL.md 〈升级与决策〉;派发词逐字粘贴,dev ⛔ 不留副本。 - 每个方案逐轴分析,推荐也按那些轴给理由;派发词没带,停下向 PM 索取,⛔ 不自拟一套轴。 - `main` 碎了、依赖未合并、CI 基础设施故障 ⇒ 报 `blocked` 附证据,重试到排除你的改动。 +- 报 `blocked` 须写明卡的哪部分不等阻塞可先做;只挡一部分 ⇒ 席位把等待部分拆成单卡。 ## 终报消息 —— 恰好这段 JSON,不带任何环绕散文 diff --git a/.claude/skills/pm-dispatch/SKILL.md b/.claude/skills/pm-dispatch/SKILL.md index f197bb6797d..c1fb96e24fb 100644 --- a/.claude/skills/pm-dispatch/SKILL.md +++ b/.claude/skills/pm-dispatch/SKILL.md @@ -113,11 +113,10 @@ PM 的工作是循环:选卡 → 认领 → 派发 → 收集 → L1 审核 → | open + 队列标签 + 无 assignee | 可派发(同卡带 `pm:retriage` 的除外);`pm:queue` 卡恒无 assignee,有即半态;`pm:blocked`/`pm:on-hold` 同 | | assignee 已设 | 已认领/在飞,不是你的就永不碰;离手恒走释放 —— 三因 = 改路由(限未派发)、前提证伪、弃飞无接管,去向 = 新标签态或车道;在飞卡跟到 MERGED,⛔ 不静默摘 assignee;入停放态(queue/blocked/hold)同笔摘 | | `pm:dispatched` | 已派发(派发评论记轮次),恒带 assignee;与摘 `pm:queue` 同一次标签写入成对落地 | -| `needs-user-decision` | 决定待做:永不派发、永不代答;维护者的决策收件箱,只挂决策卡(issue)、⛔ 永不挂 PR,只由人工裁 | -| `pm:on-hold` | 决定已做且答案是暂不做:不派发不催;仅当带机器可读 `Restart-when:` 行才合法;入态 ⛔ 不降级,级只反映严重度 | -| `pm:blocked` + 正文行 `Blocked-by: #N` | 等上游:选择期跳过,#N 关单(PR 则合并,关而未合并不放)时由解锁扫描或 `scheduled-full-run-card.yml` 放回;工已完而被门禁卡住的同用本态;双通道行首 `Blocked-by:` 指向无 `Ruled:` 的 open `needs-user-decision` 卡 ⇒ ⛔ 不派发,直至其 `Ruled:` | -| `pm:awaiting-maintainer` | 决定已做,只剩一次 GitHub 之外的人工动作:不派发不催;与其它 pm 状态标签互斥;入态恒带行首 `Maintainer-action:` 行(细则见 `references/state-machine.md`),无行即半态 | -| `pm:blocking` | 挡着在派 area 里的 open 卡(自 `Blocked-by:` 索引推导的缓存,⛔ 不手工挂);⛔ 不抬级、不插队 | +| `needs-user-decision` | 决定待做:永不派发、永不代答;维护者的决策收件箱,只挂决策卡(issue)、⛔ 永不挂 PR,只由人工裁;等维护者产品选择的卡带选项与推荐入此态,⛔ 不停在 `pm:blocked`/`pm:awaiting-maintainer` | +| `pm:on-hold` | 决定已做且答案是暂不做:不派发不催;仅当带机器可读 `Restart-when:` 行才合法;入态 ⛔ 不降级,级只反映严重度;等平台发布用本态;挡路卡与被挡卡 hold 须一致,默认被挡卡随挡路卡入 hold,维护者在卡上另说除外 | +| `pm:blocked` + 正文行 `Blocked-by: #N` | 等上游:行首 `Blocked-by:` 是唯一来源,点名 open 卡或未合并 PR;目标全关(PR 则合并)即由每日扫描放回 `pm:queue` 或改写到下一真阻塞;工已完而被门禁卡住的同用本态;指向无 `Ruled:` 的 open `needs-user-decision` 卡 ⇒ ⛔ 不派发 | +| `pm:awaiting-maintainer` | 决定已做,只剩一次 GitHub 之外的人工动作:不派发不催;与其它 pm 状态标签互斥;入态恒带行首 `Maintainer-action:` 行(细则见 `references/state-machine.md`),无行即半态;等维护者亲手动作用本态 ⛔ 不用 `pm:blocked`;码已落只差该动作 ⇒ 另立维护者卡 | | `pm:retriage` | 向分诊提问(改判、跨域 PR 指定车道、改路由、拆卡、裁 dev 报告留下的分叉;既裁冲突砍项与整树席改标归执行席 ⛔ 不问),定车道与改路由限未派发卡,异议评论写明所求;与现行 `pm:*` 并存、⛔ 不摘原标;带本标签的 `pm:queue` 卡跳过派发 | | `finding` | 立卡三类内待首次定级,定级即离标;三类外关 not planned;不占队列不进收件箱 | | `tooling` | 修复落在门禁/脚本/workflow/技能/席位协议/PM 工具面而非产品包;分诊首触打,与 `domain:*` 同笔;三具名读者 = 候选查询排除、首触即关、普查半态行 | @@ -142,7 +141,8 @@ PM 的工作是循环:选卡 → 认领 → 派发 → 收集 → L1 审核 → - `state_reason` 与关闭理由一致:撤单/不做 ⇒ `not_planned`,重复 ⇒ `duplicate` + `duplicate_of`。 - `Blocked-by:` 行是机器可 grep 的反向索引,一遍读喂三个职责,⛔ 只做第一件。 - 三职责:上游关单放回解锁卡;按解锁扇出排序;在合并后的 ref 上重验回队卡文件面。 -- 一个标签存在当且仅当有具名读者;`pm:blocking` 即其推导缓存,读者以词表脚本注为权威。 +- 一个标签存在当且仅当有具名读者;挡路关系由脚本读 `Blocked-by:` 行,⛔ 无挡路标签可打。 +- 挡路卡的级 = 自身与所挡 open 卡(同仓跨仓同)里最高者;人定的级 ⛔ 不动,扫描报维护者。 - 跨仓解锁判据是消费方可安装,⛔ 不是上游已合并;探针:装上的包是否接受新键/新行为。 - 以发布包消费上游的仓,解锁放回前先验修复已进可安装的发行版。 - 未发版 ⇒ 转 `pm:on-hold`;`Restart-when:` 写安装面判据与唤醒后派发形状,⛔ 不回 `pm:queue`。 @@ -227,7 +227,7 @@ PM 的工作是循环:选卡 → 认领 → 派发 → 收集 → L1 审核 → - 不升级类(碰产品行为或契约形状即报 fork):恢复不变量;任务顺序;验证策略;说明书脱节。 - 四类记账事同属不升级类,恒以无产品可见行为变化为界:去重与卡片合并;台账与记账整理; - 纯文档措辞更正(无契约声明改动);既有门禁内部参数与盲区修复(加强,非削弱,非新增)。 -- dev 的 `needs_decision` 一律呈人工:PM 附四维分析与推荐(含「疑属不升级类」),⛔ 不代答。 +- dev 的 `needs_decision` 一律呈人工:席位附报告转决策线程(含「疑属不升级类」),⛔ 不代答。 - 第三档:带前提的裁决,亦由人工下,三件套缺一不可:① 裁决(选定路线)。 - ② 把裁决挂在具名、可证伪的前提上,派发令要求 dev 先验前提再动手。 - ③ 显式禁令:前提不成立就报 fork,⛔ 不许硬做,也不许悄悄退回另一个选项。 @@ -278,12 +278,12 @@ PM 的工作是循环:选卡 → 认领 → 派发 → 收集 → L1 审核 → - 四维分析从业务角度写;四棱是四轴的卡面序列化,一一对应,是人工裁决的输入。 - 卡先于弹窗:需裁决先落 `needs-user-decision` 卡;列选项等答的聊天即弹窗;⛔ 不 assign 推送。 - 决策卡带选项、推荐、证据、四棱块与工作量列;受阻执行卡同笔挂 `pm:blocked`+`Blocked-by:`。 -- `AskUserQuestion` 只是在场加速器:仅当维护者在本会话 ~30 分钟内有过人类输入才可发。 -- 每问必带推荐项,被 Skip 或长挂即转卡通道,⛔ 不重弹。 +- 需人工裁先过天花板档:卡入决策箱、放认领,席位请协调者开决策线程,裁决由席位录卡。 +- ⛔ 席位、分诊与 dev 不在自己会话直接问维护者;细则见 `references/decision-analysis.md`。 - 推送维护者:受管 PR 待批合、决策卡待字、发版、仅其可解之阻 ⇒ 另发 `PushNotification`。 - 一行 ≤200 字,先写动作与编号;每项恰一次,例行进展、刚问刚答与在场即见的不推。 - 总监席档位由维护者按项目人工定,每场记入摘要台账;⛔ 无档位硬门、无免档整理态。 -- 总监席是唯一呈裁席:决策箱只经本席呈维护者人工裁;⛔ 无代裁无自裁无子代理。 +- 呈裁只经总监席与天花板档决策线程,恒由维护者人工裁;⛔ 无代裁无自裁无子代理。 ## 报告契约 diff --git a/.claude/skills/pm-dispatch/references/coordinator.md b/.claude/skills/pm-dispatch/references/coordinator.md index e07a0f7635f..9a4d568b130 100644 --- a/.claude/skills/pm-dispatch/references/coordinator.md +++ b/.claude/skills/pm-dispatch/references/coordinator.md @@ -32,9 +32,9 @@ - 档位与 effort 的定法住 `execution-duties.md` 派发节:档位引 `dispatch-gates --tier`,effort 按卡难度。 - 改协议语义面卡恒 `CONTRACT_REVIEW_TIER`,⛔ 不抄模型名;隔离子代理照 `--brief-template` L2 审核。 -## 五、卡线程的 `needs_decision`(coordinator 收到时读;席位写分析时读) +## 五、卡线程的 `needs_decision`(coordinator 收到时读;席位请裁时读) -- 规则一处:`lanes/director.md` 与 `dispatch-runbook.md` 卡线程节;本文只指不抄。 +- 席位请裁 ⇒ 开天花板档决策线程(effort `xhigh`),附 dev 报告;规则住 SKILL.md〈升级与决策〉。 - 等裁的卡线程不占槽(见第三节);裁决记录 = 卡上裁决评论,⛔ 不落项目文件或记忆。 ## 六、额度压力(coordinator 每次开线程前读) diff --git a/.claude/skills/pm-dispatch/references/decision-analysis.md b/.claude/skills/pm-dispatch/references/decision-analysis.md index d7380c9245f..090b910ead1 100644 --- a/.claude/skills/pm-dispatch/references/decision-analysis.md +++ b/.claude/skills/pm-dispatch/references/decision-analysis.md @@ -29,7 +29,8 @@ - ①读数相近而工作量差 ≥3× 推荐须点名;翻字母只凭维护者卡上另裁,唯④新增门禁例外。 - 自检行「只看①选 X;②③④ 是否翻转:否 / 是(理由)」,答是不改字母,唯④新增门禁例外。 - 裁后执行段:写明裁定之后怎么执行,让维护者只裁方向不背执行。 -- 四维与推荐:天花板档可用即用它写成或复读后落卡;否则按席位档落,加 `Analysis-tier:` 行。 +- 分析与速读由 `CONTRACT_REVIEW_TIER` 决策线程写,并在该线程与维护者讨论;⛔ 无席位档退路。 +- 决策线程 effort 恒 `xhigh`,`max` 仅维护者点名;席位附报告请协调者开线程,裁后录回卡。 ## 四棱卡面块固定形状 diff --git a/.claude/skills/pm-dispatch/references/dispatch-runbook.md b/.claude/skills/pm-dispatch/references/dispatch-runbook.md index 0e0b6865566..07a5d19ed7b 100644 --- a/.claude/skills/pm-dispatch/references/dispatch-runbook.md +++ b/.claude/skills/pm-dispatch/references/dispatch-runbook.md @@ -172,7 +172,7 @@ - 衍生 sub-issue:认领席同笔写父卡域与优先级、附查重词后派发;父卡 checklist 评论记一行。 - 无主阻塞项:只做 `Blocked-by:` 点名的那一张,做完即回,⛔ 不顺手接第二张。 - 无主阻塞项的契约面(含 `packages/spec`)按 `contract-review.md` 欠达档 L2 记录。 -- 在飞阻塞项:等待者在阻塞卡留行点名自卡;级 ⛔ 不沿链继承,唯挡别仓 p1 者取该 p1 的级 +- 在飞阻塞项:等待者在阻塞卡留行点名自卡;挡路卡取自身与所挡 open 卡里最高的级 ## 停摆复位梯度 diff --git a/.claude/skills/pm-dispatch/references/execution-duties.md b/.claude/skills/pm-dispatch/references/execution-duties.md index 2de6f494fb6..6200eb58e12 100644 --- a/.claude/skills/pm-dispatch/references/execution-duties.md +++ b/.claude/skills/pm-dispatch/references/execution-duties.md @@ -53,7 +53,6 @@ - 标签序:`priority:p0` > p1(任何 area,含暂停)> 维护者点名的 area 或子专题里的下一张 > 无级。 - 云车道同按专题派,⛔ 不按 `cloud/ROADMAP.md` 行序;细则照 `lanes/cloud.md` 所指的 cloud 仓文件。 - 点名范围内:子专题照其子卡次序与 `Blocked-by:`;无子专题先 p2 后 p3;级只决定插队。 -- `pm:blocking` 的写入与摘除都在分诊轮 sweep,依赖者全关即摘。 - 全序每级现读/现算,零逐卡维护;无级/无 area/无 type 轮报记分诊缺口。 - 同级先非车队卡(作者非 `Bot` 且首行非席位签名),再 `Bug`、卡龄;⛔ 不升级、不越 p0。 - 一车道多席按全序交替取卡:席 1 奇位、席 2 偶位;只为破交替才发 `split`;认领戳仲裁。 diff --git a/.claude/skills/pm-dispatch/references/filing-gate.md b/.claude/skills/pm-dispatch/references/filing-gate.md index 35fea6d29c2..03ddea65d58 100644 --- a/.claude/skills/pm-dispatch/references/filing-gate.md +++ b/.claude/skills/pm-dispatch/references/filing-gate.md @@ -19,6 +19,9 @@ - ③ 维护者直派的任务,正文引其原话;④ 跨仓/跨层协调父单(`tracking`,非 `pm:epic`)及子单。 - 增改 pm 规则的卡只在维护者点名时立(归 ③,正文引点名原话);⛔ 席位自提不立。 - 新接口/协议键/元数据类型/审计种类/新能力另立 `Feature` 卡,⛔ 不作 `Bug` 选项,分诊拆。 +- ⛔ 不是卡:在建功能(码未合并)的问题,在该功能的卡与 PR 里修;合并后发现的才立 `Bug`。 +- 车队立的同专题卡只在改同一文件时互挡(判据同区租约重叠检查);次序偏好列在专题卡。 +- 挡路卡只挡本卡一部分 ⇒ 把要等的部分拆成单卡挂 `Blocked-by:`,其余照常排队。 - ⛔ 当前值(冻结、暂停、重点、只做 p1、并发)不进技能,只住座位贴与项目记忆; 单卡裁决只住该卡;唯常设规则进技能,须维护者明言长期有效或由他合并该规则 PR。 - 技能 PR 正文逐条引来源;引文读作临时(先/暂时/这次/现在)或只对一席说 ⇒ L1、L2 退回。 @@ -36,7 +39,7 @@ - 业务理由:谁受益、什么场景、不做会怎样;③ 以原话代,④ 承父单;分诊 ⛔ 不代写。 - 清楚且合北极星方向 ⇒ 照常定级入队;与「What gets built」不符或无受益者 = 站不住。 - 缺失或站不住 ⇒ `Triage: returned` 退回立卡人,留 `finding`,改后再读;⛔ 不代写不关卡。 -- 涉及产品取舍或方向不明 ⇒ `needs-user-decision` 入箱,总监席呈批;⛔ 不替维护者判需求。 +- 涉及产品取舍或方向不明 ⇒ 入决策箱,先过天花板档决策线程;⛔ 不替维护者判需求。 - 批量立卡(一次 ≥10 张):审计评论带 `Batch-of:` 行,总监席每源抽 ≤5 张呈维护者过目。 - 缺件卡由分诊(单车道仓 `repo:*` 席)首触补齐卡与一次检索可推三件,写进定级评论并定级。 - 补不齐(四类皆非)者才因缺件首触即关 not_planned,一行点名所缺。 @@ -54,14 +57,15 @@ - 表 ⛔ 本文不抄:本仓照北极星(大专题、核心功能与界线在「Product areas」,Bug 表、安全表 与补充规则在「Priority」第 2 条);cloud 以其仓 `docs/strategy/core-functions.md` 为准,两步同此。 - 第一步先判仓库(病根在平台 ⇒ 在 objectstack 修),再定 `area:*` 与 issue type(定义见第 2 条)。 +- type 逐卡定不随专题;`pm:epic`/`tracking` 卡不带 type;运维、验证与维护者动作卡 ⇒ `Task`。 - 第二步定级照第 2 条:只有 `Bug` 与安全卡查表;`fleet` 源 `Feature`(含体验类)定 p3。 - 「具名客户」只指真实外部用户,定级评论写谁说了什么;测试 agent 自建应用的需求不算。 - 读码得出且写明机制的发现与实测者同按表定级;⛔ 无证据上限。 - 清单项会 fail、标题断言该能力而 steps 到不了(补步骤)、无项断言(补账本):一律查表, 核心功能 ⇒ 断;⛔ 不继承清单项的 `priority`。 -- 清单断言缺陷(产品对、清单错)按 p2 修;发版窗内挡验收判定带 `pm:blocking`。 +- 清单断言缺陷(产品对、清单错)按 p2 修;发版窗内挡验收判定者,被挡卡 `Blocked-by:` 指它。 「平台测试清单反复变红,肯定要修啊」(维护者)。 -- 挡住别仓 p1 的卡取该 p1 的级,`Feature` 亦然;此外级 ⛔ 不沿链继承,「有人在等」不升级。 +- 挡路卡取自身与所挡 open 卡里最高的级,同仓跨仓同,`Feature` 亦然;余「有人在等」不升级。 - p0 照北极星;发版阻塞卡只在发版窗内升 p0(⛔ 不打 `target:`),发版后回查表所得的级。 - 定级行:`area · type · severity · reach · evidence (measured or read)`;公开卡 ⛔ 不写安全机制。 - 假绿(仪器):绿线被读作「已核对」而实际没核对 ⇒ 一次人眼捕获即一次实测代价。 diff --git a/.claude/skills/pm-dispatch/references/lanes/director.md b/.claude/skills/pm-dispatch/references/lanes/director.md index 727e48ed4e0..0337f32bade 100644 --- a/.claude/skills/pm-dispatch/references/lanes/director.md +++ b/.claude/skills/pm-dispatch/references/lanes/director.md @@ -20,7 +20,7 @@ - 双射 carve-out:一张 `pm:seat` 座位贴,四段照旧;状态块逐场一行,各记己锚,⛔ 无占席人。 - 不占 `domain:*` 车道,范围按职责标签跨车道跨仓;永不认领 backlog、永不写码。 - 改 skill、指令或治理文本归 skills 席;出裁决、清 L2 标、清点待人工清单归本席。 -- 项目内卡线程报 `needs_decision` ⇒ 席位写四维分析加推荐,并入决裁批次呈维护者人工裁。 +- 项目内卡线程报 `needs_decision` ⇒ 席位卡入决策箱,放认领,请协调者开决策线程,裁后录卡。 - 维护者令「必须人工决裁」撤销「有把握自己决定」;⛔ 无裁决线程、代裁、置信门。 - 应用仓召唤本席复核卡的业务理由首触,三出口同分诊;没把握 ⇒ 报该应用的总监(人)裁。 diff --git a/.claude/skills/pm-dispatch/references/state-machine.md b/.claude/skills/pm-dispatch/references/state-machine.md index e6ed8fa21d1..4f41a2a0ef7 100644 --- a/.claude/skills/pm-dispatch/references/state-machine.md +++ b/.claude/skills/pm-dispatch/references/state-machine.md @@ -19,16 +19,20 @@ - 机会主义重启的触发文件走 `Restart-touch: <仓内相对路径>`,一行一路径,值须为 tracked 文件。 - 该行大小写敏感、行锚定,与另两行同双通道,喂 H17 触发文件索引;存量 hold ⛔ 不迁移。 - 放行双查皆机械:只放最近一次 hold/blocked 转换评论的条件;其后卡上有新 merged PR 即拒。 +- 挡路卡 hold 而被挡卡未 hold(或反之)⇒ 默认被挡卡随之入 hold,维护者在卡上另说除外。 ## `pm:blocked` - 正典标记 = 行首 `Blocked-by: #N`(跨仓 `owner/repo#N`)、写时无装饰;读者兼收列表/粗体/反引号。 +- 该行是唯一来源:目标须为 open 卡或未合并 PR;等维护者亲手动作 ⇒ awaiting,⛔ 不挂本态。 - 句中提及刻意拒收;等 PR 合并写该 PR 号:合并才放,关而未合并 ⛔ 不放;等发布见下行。 - ⛔ 不扩词表;等发布的目标 = pin-bump 杂事卡,`Part of` 型 PR 的跟踪卡 ⛔ 不可用作目标。 - 工已完而被门禁缺陷卡住者同用本态,⛔ 不设新标签、不重派;`Blocked-by:` 指向门禁卡。 - 正文行 `Unlock-action: re-check PR #M`(重查落地)或 `re-check #N when label <标签> `。 - 只认此二值,别的拼写静默回落重派,散文另起行;停放的 PR 正文须点名那张门禁卡。 -- 上游已关 ⇒ 先重新推导是否有新阻塞并改写该行,⛔ 不反射式放行。 +- 目标全关(PR 已合并)⇒ 每日扫描过可安装检查,一条评论放回队列;仍有阻塞即改写该行。 +- 每日扫描另报:blocked 卡无该行或无 open 目标,互挡与成环,挡路卡级低于所挡,hold 不一致。 +- 挡路卡取自身与所挡 open 卡(同仓跨仓同)里最高的级;人定的级 ⛔ 不动,由扫描报维护者。 - `scheduled-full-run-card.yml` 经 `scripts/ci/scheduled-full-run.mjs` 刷新小时红卡时亦放回,规则更窄: - 双通道目标全为本仓已关卡(PR 已合并)、无 `Unlock-action:` 行与 assignee 才放;跨仓已关不放。 - 正文是正典家:新 blocker 停在评论、正文留已关旧目标 ⇒ 巡查报 stale 并要求迁回正文。 @@ -37,6 +41,9 @@ - awaiting 入态带 `Maintainer-action: <席位做不了的动作> — done when <可查证据>`,双通道行锚定。 - 写不出即决定待做;本态无机器出口:维护者完成后由总监席核验摘标 + 证据评论同笔。 +- 开发卡码已落只差维护者动作 ⇒ 席位另立维护者卡(本态+该行),关开发卡,放开所挡卡。 +- 真要等该动作结果的卡,`Blocked-by:` 改指新立的维护者卡。 +- 等维护者产品选择 ⇒ 带选项与推荐入决策箱,⛔ 不停 blocked/awaiting;逾 3 天每日扫描列出。 - retriage 原定级在改判前仍是权威;awaiting 卡在在飞视图里计停放库存。 - 挂标者 = 提出异议的席位,挂标与异议评论(证据 + 所求的答案)同笔;⛔ 裸挂标不合法。 - 摘标者 = 分诊 Routine,每 fire 先答异议评论所求、答后同笔摘标;老化兜底归巡查 H18。 diff --git a/.claude/skills/pm-dispatch/references/triage-duties.md b/.claude/skills/pm-dispatch/references/triage-duties.md index 6813d8b45bf..f65916e1009 100644 --- a/.claude/skills/pm-dispatch/references/triage-duties.md +++ b/.claude/skills/pm-dispatch/references/triage-duties.md @@ -35,8 +35,7 @@ - 分诊每轮读上轮以来新贴的自分诊记录,逐条回复确认或改判;复审前席位定级有效。 - 分诊定级轮读车道 `Suggested-grade:` 行:是输入不是定级,确认或改判,不采纳给理由。 - 分类动作每张三选一,外加一个修复通道;裁定写方向、给六态之一。 -- 日对账 fire 读 `check-half-states` H14,在飞卡亦然:NOT carrying ⇒ `label-write.mjs --add pm:blocking`; -- stale/UNJUDGED 行手核跨仓依赖后 `--remove pm:blocking`,留则写明理由;增删卡号进轮次记录。 +- 日对账 fire 读 `check-half-states` 阻塞与决策诸行,照 `state-machine.md` 处置;卡号进轮次记录。 - 方向在 ADR/本卡裁决/不可重裁规则:贴 `check-prior-rulings.mjs` 的 `Prior rulings read:` 行,或不点。 - `pm:queue` = 有具名落点或复现的具体缺陷,无可问之事;⛔ 工具/门禁修复不由此进。 - `tooling` 入 `pm:queue` 仅凭三门之一:首行带 `Unblocks: #N`(open 产品卡)或点名所护的已发布面; @@ -64,6 +63,7 @@ - 先修复:正文被 sanitizer 截断的卡不可派发,评论修复指令后跳过。 - 停摆指令判据必须比其它分类更硬(双读取),事后证伪同处公开作废。 - 首触复核 area、type(中继 `issue_patch` 写)、级与 `Source:`(核不出即 `fleet`),错即改并留原值。 +- type 照北极星第 2 条逐卡定:`pm:epic`/`tracking` 卡不带;运维、验证与维护者动作卡 ⇒ `Task`。 - 维护者或外部人立的卡首触补齐(照 `filing-gate.md`);日对账 fire 扫无 `area:*` 的公开卡补齐。 - 预授权 `Feature` 免裁:`Source: topic` 子卡、北极星路行已断言能力、既裁执行、有先例新键。 - 余 `fleet` 源者 ⛔ 不派发、不立决策卡、不自动关;分诊每周列单,维护者挑、并专题或关。 diff --git a/docs/NORTH-STAR.md b/docs/NORTH-STAR.md index de2658cb1e3..84a2ed99606 100644 --- a/docs/NORTH-STAR.md +++ b/docs/NORTH-STAR.md @@ -136,7 +136,7 @@ Area boundaries, one `area:*` per card: **Priority**: 1. Security and data integrity always come first and do not wait for the road. -2. Grading is two steps, and a card enters the queue only once both are done. **Step one, repository, area and type**: judge the repository first (a platform root cause is fixed in this repository, wherever it shows up), then give the card its `area:*` (above) and its GitHub issue type. Bug = a capability already shipped is broken, and a wrong sentence in a shipped skill or document is a Bug too; Feature = a new capability or an extension; Task = teaching new content, tooling, CI, evals. A record card or an anchor card takes no type and no grade. A card hangs under a sub-epic only when the maintainer has opened one; otherwise its `area:*` is enough to enter the queue. **Step two, the grade**: only Bug cards and security cards are graded by the two tables below, and UX problems by the UX rule below. A Feature that improves UX defaults to p2 when its source is the maintainer or a topic (an epic he opened or confirmed); a fleet-sourced Feature, UX included, is p3 and, unless pre-authorised, goes on the weekly list, which triage owns; any other Feature never enters p1 (unless it blocks another repository's p1, below) and is done in its area's order; a Task defaults to p3, and only rises to p2 when it blocks work being dispatched. Severity has four levels: +2. Grading is two steps, and a card enters the queue only once both are done. **Step one, repository, area and type**: judge the repository first (a platform root cause is fixed in this repository, wherever it shows up), then give the card its `area:*` (above) and its GitHub issue type. Bug = a capability already shipped is broken; a wrong sentence in a shipped skill or document is a Bug too, and so is a shipped feature slow enough to hurt its use; Feature = a new capability or an extension; Task = teaching new content, tooling, CI, evals, a pure refactor or technical debt, and operations and verification work (a staging read, a one-off data fix, a maintainer-action card). An experience problem whose fix needs no new interface or capability is a Bug, graded by the UX rule below; one that needs it is split off as a separate Feature. A record card or an anchor card takes no type and no grade, and an epic or a tracking card (`pm:epic`, `tracking`) takes no type either: types go only on cards with work to do. A bug found during development is typed card by card, not by its epic: a problem in the feature being built, whose code has not merged, gets no card and is fixed in that feature's card and PR; once that feature has merged but is not yet released it is a Bug under that epic, graded by the table (usually p2 or p3, since no user has met it yet; raised when it blocks a release); a problem found in another, shipped feature is an ordinary Bug, its area that of the broken feature, graded by the table, and it hangs under this epic with a `Blocked-by:` line only when it blocks the epic. A card hangs under a sub-epic only when the maintainer has opened one; otherwise its `area:*` is enough to enter the queue. **Step two, the grade**: only Bug cards and security cards are graded by the two tables below, and UX problems by the UX rule below. A Feature that improves UX defaults to p2 when its source is the maintainer or a topic (an epic he opened or confirmed); a fleet-sourced Feature, UX included, is p3 and, unless pre-authorised, goes on the weekly list, which triage owns; any other Feature never enters p1 (unless it blocks a p1, below) and is done in its area's order; a Task defaults to p3, and only rises to p2 when it blocks work being dispatched, or higher by the blocker rule below. Severity has four levels: - **Severe**: a security overreach, or data silently wrong, lost or leaked across tenants. "Data wrong" means only that a stored value is wrong or lost; a value read back and shown wrongly is Impeded. - **Broken**: a core feature of the area table cannot be done, and there is no workaround. - **Impeded**: there is a workaround (same role, same entry point, named by the error or the documentation); a feature that is not core cannot be done; an error that cannot be understood. @@ -162,7 +162,7 @@ Area boundaries, one `area:*` per card: Also: - The UX rule, for `area:ux` and for an experience problem in any other area: a UX problem on a core feature that every user hits every time is p1; every other UX problem is p2. UX has no p3. - A wrong sentence in a shipped skill or document is a Bug, with the reach "builders, often", because AI copies it into what it writes. - - "Someone is waiting" raises no grade. A card that blocks another carries `pm:blocking` only when the blocked card is in an area being dispatched, and the grade is not inherited up the chain — except that a card blocking another repository's p1 takes that card's grade, a Feature included. + - "Someone is waiting" raises no grade on its own. A card that an open card names in a `Blocked-by:` line takes the highest grade among its own and the open cards it blocks, in this repository or another, a Feature included; a grade the maintainer set by hand is not moved, and the daily scan reports it to him instead. The blocking relation is read from those `Blocked-by:` lines by script, and no label is typed for it. - A p3 with no effect on users (review nits, internal comments, wording) is closed at first touch and never queued. - p0 is time, not severity, and only these: main or the merge queue red, a release blocker inside the release window, a security hole being exploited in production. - The grading comment carries one line: area · type · severity · reach · evidence (measured, or read from the code). From a927e6badc1d086d9221aab4e2091ad30dccc7d5 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Nov 2026 06:11:26 +0000 Subject: [PATCH 2/8] wip(pm): read the blocking relation from the Blocked-by lines in the half-state patrol Checkpoint of the script half of the blocking-mechanism card. The patrol drops the two rows that audited the retired pm:blocking cache (H14, H15) and every reader of that label (the comment-fallback gate, the closed-card residue set, the H67 read order), and gains the relation rows H77-H81: a block that names no open target, a blocker graded below a card it blocks, a hold mismatch, mutual blocks and cycles, and a decision-box question left unanswered past three days. The ledger row cap rises 64 -> 72 because the registry now holds 66 families. Self-test: 5250 cases pass. The new rows' own battery is the next commit. Claude-Session: https://claude.ai/code/session_01Utp6CaAqjP52wVTzs99H5G Co-authored-by: Claude --- scripts/pm/check-half-states.mjs | 1532 ++++++++++++++++-------------- 1 file changed, 838 insertions(+), 694 deletions(-) diff --git a/scripts/pm/check-half-states.mjs b/scripts/pm/check-half-states.mjs index a1b55a00b0b..873b01e968c 100644 --- a/scripts/pm/check-half-states.mjs +++ b/scripts/pm/check-half-states.mjs @@ -179,7 +179,7 @@ * hold state legal * ONLY with a machine-readable exit: `Restart-when: closed #N` * (fired by the same unlock scan as `Blocked-by:`, and since #10403 over - * the same TWO channels — body OR comment, the H4/H14 contract; a + * the same TWO channels — body OR comment, the H4 contract; a * comment-parked exit fired and sat unnoticed ~2 days under the old * body-only read) or a one-line executable predicate. A hold nothing can fire * is indistinguishable from an abandoned card. ⚠️ A `closed …#N` exit @@ -233,43 +233,16 @@ * when the card's own title/body self-declares P0/data-integrity: for * that class the emergency-triage channel (immediate triage subagent) * is the mandated move, never the hourly Routine. - * H14 `pm:blocking` cache incoherence, in BOTH directions, read off the - * `Blocked-by:` reverse index this sweep already has the bodies for. - * `pm:blocking` is not a state a seat sets: the state model makes it a - * CACHE the triage sweep derives from that index (「分诊 sweep 自 - * `Blocked-by:` 索引推导的缓存,⛔ 不手工挂」), and the lane selection - * order ranks it second only to `priority:p0`. A cache with a ranking - * consumer and no coherence check drifts in two different ways, and - * each lies differently: a card carrying the label that NOTHING targets - * is boosted past fresher work on the authority of a dependency that - * does not exist (worse than an absent label — it lies with authority), - * while a card that IS targeted and does NOT carry it is a real - * unblocker the selection order cannot see. Report-only, and pointedly - * so: the producer is the triage sweep's derivation pass, so the remedy - * is always a derivation that runs, never a label written from here. - * The index it reads is the UNION of both channels (body ∪ comment), - * for the same reason H4 reads both — and here the cost of reading one - * was measured: #9465 and #9968 were reported stale while their - * dependents (#9709/#9828 and #9969/#9652) stated the wait in comments. - * That is the 「量具错位」 the 2026-08-19 ruling on #9948 named — 「修量 - * 具而非追假 stale」 — and both shapes are regression pins now. The two - * directions treat an INCOMPLETE index differently on purpose: stale is - * a claim about absent evidence and is suspended when any gated comment - * fetch failed, while missing is a claim about evidence in hand and - * cannot be manufactured by reading more. See the predicate. - * Both directions were non-empty at the reading this item landed on - * (2026-08-19, 234 open cards, 17 `Blocked-by:` body lines): ONE stale - * card and FIVE missing ones, with not a single coherent pairing on the - * board — the cache had no reader checking it and had drifted to 0% - * agreement with the index it is derived from. - * H15 the oldest UNCLAIMED `pm:blocking` card and its age — one row, no - * threshold, selection-order compliance made visible (maintainer, - * 2026-08-19: 「然后车道项目经理应该优先处理 blocking」). Where H14 asks - * whether the cache is TRUE, H15 asks whether anyone acted on it: a - * lane that keeps taking fresher picks past an unclaimed blocking card - * now says so on the anchor, by name. Deliberately not an alarm and - * deliberately unconditional — see the rationale on the predicate for - * why this one carries no threshold constant. + * H14, H15 — RETIRED with the `pm:blocking` label. They audited a label + * CACHE derived from the `Blocked-by:` reverse index (H14) and the + * order that consumed it (H15). The label left the vocabulary: the + * blocking relation has ONE source, the line-start `Blocked-by:` + * lines, and no label is typed for it — so there is no cache left to + * be incoherent and no rank left to comply with. ⛔ The two codes are + * never reused: an archived anchor row or a disposition citing one + * keeps meaning what it meant. What the relation OWES is read off the + * same index by H78–H80, and what ENDS a block by H19 and H77 — see + * 「The blocking relation, read from the lines」 below. * H16 an OPEN, non-draft PR sitting in a MERGE CONFLICT * (`mergeable_state` = `dirty`) past the threshold — the one board state * no instrument here could express before it (devx incident, @@ -280,7 +253,7 @@ * "the queue is handling it" (H12's own reading, correct there and * exactly wrong here). The measured specimen hung ~4h with nobody aware. * The incident's lesson, verbatim: 「一个无法表达某状态的仪器,会把它报成 - * 它能表达的最近状态。」 — which is what H1–H15 were doing to this state. + * 它能表达的最近状态。」 — which is what every earlier item did to this state. * Two consequences shape the item. It is the only one needing a per-PR * GET (`mergeable_state` is absent from the `/pulls` LIST payload and * lives on the single-PR endpoint alone), taken for CANDIDATES only and @@ -352,7 +325,7 @@ * ⭐ The card's reading three — 「`list_issues` 只能按 label / state / since * 过滤,不返回正文检索」 — is true of that MCP tool and FALSE of this * script's REST reader, which lists every open card AND already fetches - * the comment channel to build H14's reverse index. So ④ is ONE LOOKUP + * the comment channel to build the reverse index. So ④ is ONE LOOKUP * over an index this file already has, not a new channel. That sentence * is written here so the next reader does not re-file the card. * @@ -363,9 +336,9 @@ * - POPULATION. Dependent BODIES come from the unscoped open-issue * listing (every open card in this repo, bounded by * `OPEN_LISTING_PAGE_CEILING`); dependent COMMENTS come only from - * open `pm:blocked` / `pm:blocking` cards whose body is clean + * open `pm:blocked` cards whose body is clean * (`needsBlockedByComments`). A card that parks the line in a - * comment and carries neither label is OUTSIDE the read, and a + * comment and does not carry that label is OUTSIDE the read, and a * cross-repo dependent is dropped by `buildBlockingIndex` by * construction. The rendered scope line says exactly this rather * than widening the read, which would be a different index. @@ -400,7 +373,7 @@ * label-APPLICATION event, and every triage answer (whatever it decides) * bumps `updated_at`, so a stale reading means nothing touched the card * since some triage pass — which is exactly the failure this item exists - * to name. Report-only and NOT loud, like H14–H16: the remedy is the + * to name. Report-only and NOT loud, like H16: the remedy is the * triage Routine's next fire, never a label written here. * * ## H19 — the question that ENDS a block @@ -409,9 +382,9 @@ * PR target, MERGED: the issues API answers an abandoned PR `closed` too, * and a PR that never merged landed nothing, so it founds no row and * withholds a full discharge (#27925) — the - * block has outlived its blocker. Two items already read that line and - * NEITHER expires a block: H4 asks whether the line EXISTS, H14 asks the - * REVERSE index (does anything target THIS card). Nothing asked whether + * block has outlived its blocker. H4 already read that line and does + * NOT expire a block: it asks whether the line EXISTS, and the reverse + * index asks what targets THIS card. Nothing asked whether * the issue the line NAMES is still open, so an expired block sat in * complete silence with a well-formed line, a correct label and no row * anywhere. Two measured instances, both found by READING and neither by @@ -458,7 +431,7 @@ * dispatch call never made, 74 minutes `pm:dispatched` with nobody on it * until a patrol tick compared branch heads. Every adjacent row declines * it for a reason of its own — H2 wants a MISSING claim comment and this - * one is complete, H4/H14 want `Blocked-by:`, H9 wants a hold, H8 wants + * one is complete, H4 wants `Blocked-by:`, H9 wants a hold, H8 wants * a merged PR and nothing here ever ran — so the shape had no reader. * ⛔ The key is NO REF AT ALL and never "no PR yet": a dev inside a long * build legitimately has a ref and no PR for over an hour (measured @@ -674,6 +647,45 @@ * FREE: the same resolutions H19 and H26 already hold, asked a third * question — which CHANNEL each target arrived in. * + * ## The blocking relation, read from the lines — H77–H81 + * + * The `Blocked-by:` line is the ONLY source of a block. No label carries the + * relation (H14/H15's `pm:blocking` cache is retired), so everything a block + * owes is read from the lines themselves — the resolutions H19 already holds, + * and the reverse index instruction ④ already builds. All five are FREE: no + * request, no listing and no summary clause of their own. + * + * H77 an open `pm:blocked` card whose line names NO OPEN TARGET and that + * H19 does not already report: the line names no card or PR at all, + * or every target it names is a PR that closed UNMERGED. H4 is silent + * (a line exists) and H19 is silent (nothing merged or closed as + * done), so the card waits on nothing nameable and no close can ever + * release it. A block is a wait on an open card or an unmerged PR; a + * wait on the maintainer's own action, on his product choice or on a + * platform release is a DIFFERENT state, and the row names all three. + * H78 a BLOCKER graded BELOW a card it blocks. A blocker takes the highest + * grade among its own and the open cards it blocks. The row sits on + * the blocker and names the read that decides who acts: a grade the + * fleet wrote is raised by triage, a grade a person set by hand is + * ⛔ not moved and is reported to the maintainer. + * H79 a HOLD MISMATCH: a blocker is `pm:on-hold` while a card it blocks is + * not, or the reverse. By default the blocked card follows its blocker + * onto hold, unless the maintainer said otherwise on the card; the + * reverse direction has no default and is reported as such. + * H80 MUTUAL BLOCKS and CYCLES: cards whose lines wait on each other. Each + * reads as a well-formed block with an open target, so every other + * row is silent on it — and no close can release any of them. + * H81 a card in the decision box (`needs-user-decision`) with no ruling + * recorded, open past `DECISION_UNANSWERED_STALE_DAYS`. The list the + * daily scan puts in front of the maintainer; a RULED card still in + * the box is H73's, never this row's. + * + * (b) of the same family — a block whose every target has closed (a PR: + * merged) — is H19, unchanged in what it reads. This script does not write: + * the row is the candidate, and the daily scan returns the card to + * `pm:queue` with one comment after the installable check, or rewrites the + * line to the next real blocker. + * * ## The close mechanism, measured (#8293) * * A half-delivered card (#8131) was closed `completed` two seconds after its @@ -1897,7 +1909,7 @@ export function h3QueueAndDispatched(issue) { } // --------------------------------------------------------------------------- -// The `Blocked-by:` COMMENT channel — read by H4 and by the H14 index alike. +// The `Blocked-by:` COMMENT channel — read by H4 and by the reverse index alike. // // Since #10403 the comment channel is no longer `Blocked-by:`-only: H9's // `Restart-when:` reads it too, through its own gated fallback in the sweep @@ -1928,8 +1940,8 @@ export function h3QueueAndDispatched(issue) { // Reading the whole first page instead errs in ONE direction, and it is the // safe one. Extra evidence can only ADD `Blocked-by:` edges: it can clear an // H4 row (the duty really was discharged, in the other channel) and it can -// clear an H14 stale row (something really is waiting), which is the -// recalibration #9948 ruled for. What it cannot do is invent a card's silence. +// add an edge to the reverse index (something really is waiting), which is +// the recalibration #9948 ruled for. What it cannot do is invent a card's silence. // The residual cost is a genuinely OBSOLETE comment edge — a line written, then // the body rewritten to drop the dependency — which needs the source card to // still be open, still labelled, and still body-clean; in that state the source @@ -1940,7 +1952,7 @@ export function h3QueueAndDispatched(issue) { // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- -// DECORATED DIRECTIVE LINES — the shared anchor for `Blocked-by:` (H4, H14) +// DECORATED DIRECTIVE LINES — the shared anchor for `Blocked-by:` (H4, the index) // and `Restart-when:` (H9). #10102, ruled option C on 2026-08-20. // // ## What the old anchors required, and the two harms that cost @@ -1948,7 +1960,7 @@ export function h3QueueAndDispatched(issue) { // Both directives are machine-readable lines written by hand IN MARKDOWN, so // authors code-format them: 「`Restart-when: …`」 is the natural spelling for a // line whose whole purpose is that a machine greps it. The original anchors -// (`^\s*` for H9, `^[ \t]*` for H4/H14) accept only whitespace before the key, +// (`^\s*` for H9, `^[ \t]*` for H4 and the index) accept only whitespace before the key, // and a backtick is not whitespace — so a DECORATED directive read as an // ABSENT one. Measured twice on 2026-08-20, once on each predicate, failing in // OPPOSITE directions: @@ -2143,10 +2155,10 @@ export function hasBlockedByLine(text) { * * - `pm:blocked` — the population H4 judges, and the edge SOURCES the index * is missing (a seat parks the line in a comment; the body stays clean). - * - `pm:blocking` — the population H14's stale direction judges. Their own - * comments matter as index sources too: a `pm:blocking` card that is - * itself waiting on another `pm:blocking` card contributes the very edge - * that defends that other card from a stale verdict. + * + * ONE state. The retired `pm:blocking` label used to be a second arm here, + * for a stale-cache verdict that no longer exists; with it gone the gate is + * exactly H4's population. * * A card whose body already carries the line is never fetched: its duty is * discharged in the channel the machinery already reads, and the census bound @@ -2155,8 +2167,7 @@ export function hasBlockedByLine(text) { */ export function needsBlockedByComments(issue) { if (hasBlockedByLine(issue?.body)) return false; - const labels = labelNames(issue ?? {}); - return labels.includes('pm:blocked') || labels.includes('pm:blocking'); + return labelNames(issue ?? {}).includes('pm:blocked'); } /** @@ -2221,7 +2232,7 @@ export function commentBlockedByTargets(commentBodies) { // An anchored sentence naming `#N` is a CANDIDATE. The clause names candidates // and their state and stops: it never says the card is unblocked, it writes no // label, and the remedy stays the one H4 always had — write the line. Same -// posture H14 holds for `pm:blocking` and H19 for a released block, and the +// posture H19 holds for a released block, and the // exit code is untouched: a completed sweep still exits 0 whether it found 0 // or 40 half-states. // @@ -2245,7 +2256,7 @@ export function commentBlockedByTargets(commentBodies) { * * Two shapes are deliberately ABSENT. `Blocked-by` is the DIRECTIVE, and H4 * fires only when it is missing from both channels, so it can never be a prose - * candidate. Bare `blocking` is the LABEL `pm:blocking` being discussed far + * candidate. Bare `blocking` is the retired LABEL `pm:blocking` being discussed far * more often than a block being stated — five such lines on #16184 alone at * the measured reading — and admitting it would fill the clause with refs to * cards nobody is waiting on. @@ -2484,13 +2495,10 @@ export function proseBlockerClause(candidates, heldBack = 0) { * channel could not be read instead of asserting that it is empty. * - `string[]` — read. Both channels judged, for real. * - * The unreadable case fires where H14's stale direction goes QUIET on the same - * failure, and the asymmetry is deliberate, not an inconsistency. H4's remedy - * is "add a line" — idempotent, cheap, and harmless if a comment already had - * one. H14-stale's remedy is "drop a label the selection order depends on" — - * destructive, and the measured false positive this whole fallback exists to - * end. An unreadable reading must surface on the cheap side and must never - * drive the expensive one. + * The unreadable case FIRES, deliberately. H4's remedy is "add a line" — + * idempotent, cheap, and harmless if a comment already had one — so an + * unreadable reading surfaces on the cheap side. It must never drive a + * destructive one. */ export function h4BlockedNoBlockedBy(issue, commentBodies, proseCandidates, proseHeldBack = 0) { if (!labelNames(issue).includes('pm:blocked')) return null; @@ -3158,7 +3166,7 @@ export function h8MergedPrStillDispatched(issue, mergedPrs, openPrs) { // Same shape as H4 (the label's machine half is a written line): the same // decorated-directive anchor, and — since #10403 — the same channel contract: // -// H4 / H14 `Blocked-by:` body OR comment (since PR #10075) +// H4 `Blocked-by:` body OR comment (since PR #10075) // H9 `Restart-when:` body OR comment (since #10403) // // H9 was body-only on purpose while the unlock machinery was: a condition @@ -3580,7 +3588,7 @@ export function h9OnHoldNoRestartWhen(issue, commentBodies, isTracked = () => fa `Add or repair the line first. Closing is the LAST resort and applies only to a card that ` + `genuinely has no fireable exit: such a card is closed \`not planned\` with reason + ` + `provenance in the closing comment (type:Bug holds re-route instead — see the state model's ` + - `Bug branch). Channel: like \`Blocked-by:\` (H4/H14), a \`Restart-when:\` line counts from ` + + `Bug branch). Channel: like \`Blocked-by:\` (H4), a \`Restart-when:\` line counts from ` + `the body OR a comment — either channel discharges the duty, and the unlock scan reads both ` + `(#10403 closed the old body-only gap).` ); @@ -3885,16 +3893,19 @@ export function h13DomainWithoutPmState(issue, nowMs = Date.now()) { } // --------------------------------------------------------------------------- -// H14 + H15 — the `pm:blocking` cache and the order that consumes it -// (maintainer-approved 2026-08-19, verbatim: 「同意」). -// -// Both items read ONE structure, built once per sweep from bodies the unscoped -// pass already fetched: the `Blocked-by:` reverse index. Everything above is a -// predicate over a single card; these two are the first that need the whole -// open set, because incoherence is a relation between two cards and "oldest" -// is a relation among many. That is a shape difference, not a contract change -// — they stay pure functions over listings the caller supplies, so the -// self-test drives them offline exactly like H1–H13. +// The `Blocked-by:` reverse index — the ONE structure every relation row reads. +// +// Built once per sweep from bodies the unscoped pass already fetched, plus the +// gated comment fallback. Everything above is a predicate over a single card; +// the rows fed from here are the first that need the whole open set, because a +// block is a relation between two cards. That is a shape difference, not a +// contract change — the builder and its readers stay pure functions over +// listings the caller supplies, so the self-test drives them offline exactly +// like H1–H13. +// +// H14 and H15 lived here and are RETIRED with the `pm:blocking` label they +// audited: the relation has one source, the lines parsed below, and no label +// is typed for it. The readers that remain are instruction ④ and H78–H80. // --------------------------------------------------------------------------- /** @@ -3977,11 +3988,11 @@ export function blockedByTargets(body) { * repo name) is kept; a bare `#N` is local by definition. * * Self-references are dropped too: a card cannot be its own unblocker, and - * counting one would make it permanently `pm:blocking`-worthy on its own say-so. + * counting one would read as a one-card cycle on the card's own say-so. * * @param {{ number: number, body?: string }[]} issues — OPEN issues only. The * index's whole meaning is "open cards that are waiting", so the caller's - * listing is what bounds it; a closed dependent must not hold a label alive. + * listing is what bounds it; a closed dependent is not waiting on anything. * ## Two channels, UNIONED — never a priority order (#10061) * * `options.comments` supplies, per source card number, the comment bodies the @@ -4025,7 +4036,7 @@ export function buildBlockingIndex(issues, options = {}) { } /** - * How many dependent card numbers a missing-cache row names before it counts + * How many dependent card numbers a relation row names before it counts * the rest. The row exists to be ACTED on — a reader wants to see who is * waiting — but the markdown renderer writes into a body with a hard cap and * a fold, and an unbounded fan-out list is the one row that could push others @@ -4034,275 +4045,344 @@ export function buildBlockingIndex(issues, options = {}) { */ export const BLOCKING_DEPENDENT_LIST_CAP = 5; +// --------------------------------------------------------------------------- +// H78 + H79 + H80 — what the `Blocked-by:` reverse index says about the cards +// it relates (#35259). +// +// The blocking relation has ONE source, the line-start `Blocked-by:` lines, +// and no label is typed for it: the `pm:blocking` cache this section used to +// audit (H14, H15) is retired with its label. What the relation OWES is read +// straight off the index instead, three ways: +// +// H78 a blocker graded BELOW a card it blocks — a blocker takes the +// highest grade among its own and the open cards it blocks; +// H79 a HOLD MISMATCH — a blocker on `pm:on-hold` while a card it blocks +// is not, or the reverse; +// H80 MUTUAL BLOCKS and CYCLES — cards that wait on each other, which no +// close can ever release. +// +// All three are relations between cards, so they need the whole open set and +// read ONE structure, built once per sweep from bodies the unscoped pass +// already fetched plus the gated comment fallback. They stay pure functions +// over listings the caller supplies, and none adds a request. +// +// SCOPE, said once for the three and repeated on every row: the index holds +// THIS REPO's edges. `buildBlockingIndex` drops a cross-repo ref by +// construction, so a blocker or a dependent living in a sibling repo is +// outside these rows — unread, ⛔ not absent. An index with unread comment +// threads can only be MISSING edges, and each row here is a claim about edges +// IN HAND, so a fallback shortfall suspends none of them. +// +// Report-only, like everything here: the daily reconciliation fire reads the +// rows and acts under `references/state-machine.md`. ⛔ No label, grade or +// comment is written from this script. +// --------------------------------------------------------------------------- + /** - * The `repo:*` labels a card carries — the SEAM predicate H14's stale - * direction declines on (#13975). - * - * Exported and pinned for the reason every scoping policy in this file is: a - * policy that decides what gets JUDGED AT ALL is where a silent hole would - * live. The spelling is `censusLanesOf`'s, deliberately — one reading of the - * `repo:*` family, so the two rows cannot come to disagree about what a repo - * lane is. - * - * ⚠️ SOUND, not COMPLETE, and the surviving rows say so. The ruled predicate - * (#13975) is "carries any `repo:*` label", which catches the cards whose - * off-repo audience is DECLARED. It is not a test for "has an off-repo - * audience": measured on the 2026-08-31 board, 67 open cards name a - * sibling-repo issue (`objectui#N` / `cloud#N` / `hotcrm#N`) and only 9 of - * them carry a `repo:*` label — and the two cards this row's own filing - * recorded off-repo waiters for (#13439, #13568) carry none. Widening it (to - * "the body mentions another repo", say) is a DIFFERENT predicate and needs - * its own ruling; narrowing it is one too. Both are why this is a named - * function rather than an inline `.some()`. - */ -export function seamRepoLabels(issue) { - return labelNames(issue ?? {}).filter((l) => /^repo:/u.test(l)); -} - -/** - * H14 — null when the cache agrees with the index, else the finding sentence. - * - * ## The two directions do NOT owe the index the same completeness (#10061) - * - * They make opposite claims, so an INCOMPLETE index endangers exactly one: - * - * - STALE ("nothing targets it") is a claim about ABSENT evidence. Every - * edge the sweep failed to read is a card that might be pointing at this - * one, so an index with any unread source cannot support the claim at all. - * `options.indexComplete === false` therefore silences this direction — - * unreadable evidence is not absent evidence (#4690), and the remedy this - * row prescribes (drop a label the selection order ranks second only to - * `priority:p0`) is destructive enough that a guess is worse than silence. - * The summary line's `comment fallback read on X of Y` is what states the - * gap, exactly as H16's and H17's `read X of Y` do for theirs. - * - MISSING ("targeted, but the label never landed") is a claim about - * evidence IN HAND. Reading more sources can only ADD edges, never remove - * one, so an incomplete index cannot manufacture this row. It stays live - * regardless — going quiet there would trade a real finding for nothing. - * - * This is the recalibration #9948 ruled for on 2026-08-19 (「修量具而非追假 - * stale」): the measured false stales #9465 and #9968 were both cards whose - * dependents state the wait in a COMMENT, and both are pinned in the self-test. - * - * ## STALE is also repo-local, and the row says so (#10139) - * - * `buildBlockingIndex` only ever scans THIS repo's open-issue listing, so - * `indexComplete` measures whether the comment fallback read every candidate - * — it says nothing about sibling repos. A dependent living in `objectui` or - * `cloud` with a `Blocked-by:` line naming this card is invisible to the - * index by construction, not by any read failure, so `indexComplete` cannot - * gate it and never claims to. The STALE sentence therefore does not read as - * exhaustive over "no dependent anywhere" — only "no dependent in this - * repo" — and its remedy is conditional on a cross-repo check rather than an - * instruction to drop the label outright: `Blocked-by:` edges are - * protocol-legal across repos (contract-first splits use them routinely), - * and #7917 / objectui#4356 is a live one this row would otherwise have - * instructed a reader to sever. - * - * ## …and on a SEAM card it declines outright (#13975) - * - * Naming the scope was not enough. The row's instruction is still imperative, - * and the class it is most often wrong about is the one the protocol creates - * ON PURPOSE: a seam card is kept in THIS repo, carrying `repo:cloud` / - * `repo:objectui` / `repo:hotcrm`, precisely so a sibling repo's work can - * depend on it. For exactly those cards "no open card here points at me" is - * not weak evidence of absence — it is the reading the index is structurally - * unable to make, and the filing round measured the cost: 4 of 5 stale rows - * stood on cards other repos were, on the record, waiting for. - * - * So `seamRepoLabels(issue)` non-empty DECLINES: the row is still emitted, and - * it says it is declining and why. Emitted rather than suppressed, on two - * measurements rather than taste: - * - * - Dropping it silently would make the seam cards INVISIBLE to the patrol — - * a card that no row mentions reads as a coherent one, which is the second - * defect, not the fix. H27 already holds this shape for the same reason - * (an UNJUDGED dispatch is reported out loud, "not confirmed healthy"). - * - The finding COUNT is unchanged by the swap, so a decline cannot quiet - * the summary sentence the way a suppression would. - * - * The row carries `UNJUDGED_MARKER`, which is the mechanical half of that - * visibility rather than a label on it: unjudged rows sort ahead of judged ones - * so the markdown body's size trim can never be what removes them (#11218, - * where the trim ate 199 rows while the header promised they were kept). An - * emitted decline the trim can drop is the suppression this row rejects, - * arriving one budget overrun later. - * - * ⚠️ H32's decline is the OTHER shape and this row deliberately does not copy - * it: there, a seat on a lane this board cannot count returns `null` and the - * summary's coverage pair carries the disclosure — correct, because the seat - * is out of the POPULATION. A seam card is in this row's population (it holds - * the label this row exists to judge); it is the EVIDENCE that is unreadable. - * - * ⛔ The decline is scoped to the stale direction alone. MISSING (the add - * direction) stays untouched on a seam card, and must: a cross-repo edge the - * index cannot see can only make that direction under-label, which is the - * status quo and harms nobody. + * The grade labels, highest first. A card's grade is the highest rung it + * carries; a card carrying none is ungraded and sits below every rung. + * + * One spelling of the ladder: H67's read order pins itself equal to it in the + * self-test, so the rank a dispatching seat reads and the rank a blocker + * inherits cannot drift apart. + */ +export const GRADE_LADDER = Object.freeze(['priority:p0', 'priority:p1', 'priority:p2', 'priority:p3']); + +/** + * Cards that by rule take NO grade — a generated anchor and a seat-registry + * post. An ungraded card of either kind that something waits on is not a + * grading gap, so H78 stays silent on it. + */ +export const GRADELESS_CARD_LABELS = Object.freeze([TRACKING_ANCHOR_LABEL, 'pm:seat']); + +/** + * The rung a card's grade sits on (0 = the top), or null when it carries no + * grade label — or when its labels could not be read, which is ⛔ never read + * as a grade. + */ +export function gradeRung(issue) { + if (!Array.isArray(issue?.labels)) return null; + const labels = labelNames(issue); + const at = GRADE_LADDER.findIndex((l) => labels.includes(l)); + return at === -1 ? null : at; +} + +/** + * dependent card number -> the LOCAL card numbers its `Blocked-by:` lines + * name: the reverse index, inverted. ⛔ No second parser and no second read — + * the edges are `buildBlockingIndex`'s own, so the two directions can never + * disagree about what a line says. * - * @param {object} issue — an OPEN issue. * @param {Map} index — from `buildBlockingIndex`. - * @param {{ indexComplete?: boolean, ownerRepo?: string }} [options] — - * `indexComplete` is `false` when any gated comment fetch failed, i.e. the - * index is known to be missing edges. `ownerRepo` is the swept `owner/repo`, - * defaulted like `buildBlockingIndex`'s and read for one purpose only: to - * tell a seam label naming ANOTHER repo from one naming this one. - */ -export function h14BlockingCacheIncoherent(issue, index, options = {}) { - const carries = labelNames(issue).includes('pm:blocking'); - const dependents = index?.get?.(issue.number) ?? []; - const indexComplete = options.indexComplete ?? true; - if (carries && dependents.length === 0) { - if (!indexComplete) return null; - const seam = seamRepoLabels(issue); - if (seam.length > 0) { - const bareRepo = String(options.ownerRepo ?? OWNER_REPO) - .split('/') - .pop(); - const named = seam.map((l) => `\`${l}\``).join(', '); - // The over-covered edge, named rather than narrowed away. `repo:objectstack` - // is not in the label ledger's seam family (`ensure-pm-labels.sh` creates - // `repo:objectui` / `repo:cloud` / `repo:hotcrm`, each described as 「Seam - // card: cross-repo ordering with X is the substance」) but it exists on the - // board and 4 open cards carried it on 2026-08-31. A label naming the SWEPT - // repo cannot make this sweep's index blind, so declining on it is - // conservative — and the row says that rather than asserting an off-repo - // audience it has no evidence for. Kept literal because the ruled predicate - // is "any `repo:*` label"; narrowing it is a predicate change and belongs to - // whoever rules on it, not to this function. - const conservative = - seam.every((l) => l.slice('repo:'.length) === bareRepo) - ? ` ⚠️ ${named} names the SWEPT repo, so this decline is CONSERVATIVE rather than ` + - 'structural — the ruled predicate is "any `repo:*` label" (#13975) and this is its ' + - 'over-covered edge, left literal rather than narrowed here.' - : ''; - return ( - // The UNJUDGED rank, not decoration: it is what keeps this row ahead of - // the markdown body's size trim (#11218). A decline the trim can eat is - // a seam card the patrol silently stops mentioning — the same defect as - // suppressing the row outright, arriving later and less visibly. - `${UNJUDGED_MARKER} ` + - '`pm:blocking` carried while no open card in THIS REPO targets it with a `Blocked-by:` line ' + - `— body OR comment — and this row DECLINES to judge the label: the card carries ${named}, a ` + - 'seam label whose whole meaning is that the ordering this card belongs to lives in another ' + - 'repo (label ledger: 「Seam card: cross-repo ordering with X is the substance」), and the ' + - 'protocol keeps such a card HERE precisely so a sibling repo can depend on it.' + - conservative + - ' The strip this row would otherwise prescribe rests on ABSENCE of evidence, and for this ' + - 'card the evidence is not absent, it is UNREADABLE (#4690): `buildBlockingIndex` scans this ' + - 'repo\'s open listing only, `Blocked-by:` edges are protocol-legal across repos, and a ' + - 'sibling repo\'s card waiting on this one is invisible to the index BY CONSTRUCTION, not by ' + - 'any read failure — ⛔ no re-run resolves it, and there is no cross-repo `Blocked-by:` ' + - 'reader in the fleet to resolve it with. ⇒ UNJUDGED: neither a coherent cache nor a stale ' + - 'one. The stakes are why this declines rather than guessing — `pm:blocking` ranks second ' + - 'only to `priority:p0` in lane selection, so a wrong strip starves the sibling that is ' + - 'waiting, while a wrong KEEP only over-ranks one card. Report-only: the remedy is a ' + - 'cross-repo `Blocked-by:` read by hand before the triage sweep\'s derivation pass touches ' + - 'this card, never a label written from this script — and ⛔ never a hand-applied or ' + - 'hand-stripped `pm:blocking` either, in any direction: the label is the sweep\'s derived ' + - 'cache (「⛔ 不手工挂」).' - ); + * @returns {Map} each list ascending. + */ +export function blockersByDependent(index) { + const out = new Map(); + for (const [target, dependents] of index ?? []) { + for (const dependent of dependents ?? []) { + const named = out.get(dependent) ?? []; + if (!named.includes(target)) named.push(target); + out.set(dependent, named); } - return ( - '`pm:blocking` carried while no open card in THIS REPO — the only board this sweep indexes ' + - '— targets it with a `Blocked-by:` line, body OR comment, judged against the two-channel ' + - 'index — a stale derived cache, scoped to THIS REPO ONLY: ' + - 'no dependent found in this repo; cross-repo dependents are not swept, so this is not a claim ' + - 'of exhaustiveness over the population — `Blocked-by:` edges are legally cross-repo. ' + - '⚠️ This card carries NO `repo:*` label, which is why the seam decline (#13975) did not ' + - 'apply — and that absence is not evidence of an in-repo-only audience: measured 2026-08-31, ' + - '58 of the 67 open cards naming a sibling-repo issue carry no `repo:*` label. The label ' + - 'is not a state a seat sets: the triage sweep derives it from the `Blocked-by:` reverse index, ' + - 'and the lane selection order ranks it second only to `priority:p0`. So a stale one is worse ' + - 'than an absent one — it boosts a card nothing depends on, with authority. Report-only: verify ' + - 'cross-repo dependents before the triage sweep\'s derivation pass drops the label (or the ' + - 'missing `Blocked-by:` line landing on the card that really is waiting), never a label written ' + - 'from this script.' - ); } - if (!carries && dependents.length > 0) { - const shown = dependents.slice(0, BLOCKING_DEPENDENT_LIST_CAP); - const named = shown.map((n) => `#${n}`).join(', '); - const more = dependents.length > shown.length ? ` +${dependents.length - shown.length} more` : ''; + for (const named of out.values()) named.sort((a, b) => a - b); + return out; +} + +const INDEX_SCOPE_NOTE = + ' Scope: THIS repo\'s open cards only — a card in a sibling repo that names this one, or that ' + + 'this one names, is not read here (unread, not absent).'; + +/** + * H78 — null when the card is graded at least as high as every open card that + * waits on it, else the finding sentence. The row sits on the BLOCKER, the + * card whose grade moves. + * + * ## Why the row names a read instead of making it + * + * A grade the maintainer set by hand is not moved; the scan reports it to him + * instead. Which kind the current grade is lives in that label's last + * `labeled` event (written through a GitHub App or by a bot actor ⇒ the + * fleet's; anything else ⇒ a person's), and that is a per-card event read this + * sweep does not buy for any row. So the sentence names the read and BOTH + * outcomes rather than guessing one — the row is correct whichever the grade + * turns out to be, and nothing here moves a grade either way. + * + * An UNGRADED blocker is reported too (it sits below every rung), except the + * kinds `GRADELESS_CARD_LABELS` names. A dependent whose grade cannot be read + * contributes nothing: unreadable is not a grade. + * + * @param {object} issue — an OPEN issue, the candidate blocker. + * @param {Map} index — from `buildBlockingIndex`. + * @param {Map} openByNumber — the open listing the index was + * built from, by card number. + */ +export function h78BlockerBelowBlockedGrade(issue, index, openByNumber) { + if (!issue || issue.pull_request || !Array.isArray(issue.labels)) return null; + const dependents = index?.get?.(issue.number) ?? []; + if (dependents.length === 0) return null; + const labels = labelNames(issue); + const own = gradeRung(issue); + if (own === null && GRADELESS_CARD_LABELS.some((l) => labels.includes(l))) return null; + const above = []; + for (const number of dependents) { + const rung = gradeRung(openByNumber?.get?.(number)); + if (rung === null) continue; + if (own === null || rung < own) above.push({ number, rung }); + } + if (above.length === 0) return null; + above.sort((a, b) => a.rung - b.rung || a.number - b.number); + const shown = above.slice(0, BLOCKING_DEPENDENT_LIST_CAP); + const named = shown.map((d) => `#${d.number} (\`${GRADE_LADDER[d.rung]}\`)`).join(', '); + const more = above.length > shown.length ? ` +${above.length - shown.length} more` : ''; + const top = GRADE_LADDER[above[0].rung]; + const carried = own === null ? 'no grade label' : `\`${GRADE_LADDER[own]}\``; + return ( + `${carried} on a card that ${dependents.length} open card(s) name in a \`Blocked-by:\` line, ` + + `graded BELOW ${above.length} of them: ${named}${more}. A blocker takes the highest grade among ` + + `its own and the open cards it blocks, a Feature included, so this card's grade is \`${top}\`. ` + + 'Report-only, and the grade is not this script\'s to move: read the last `labeled` event of the ' + + 'current grade label first. Written through a GitHub App or by a bot actor, it is the fleet\'s — ' + + 'triage raises it and leaves one comment. Set by a person, it is the maintainer\'s hand-set grade: ' + + '⛔ not moved, and this row is what the daily scan reports to him.' + + INDEX_SCOPE_NOTE + ); +} + +/** + * H79 — null when the card's hold state agrees with the open cards it waits + * on, else the finding sentence. The row sits on the BLOCKED card: by default + * that is the card that moves. + * + * Two directions, and they are not symmetric: + * + * - a blocker is `pm:on-hold` and this card is not — the default is stated + * by rule: the blocked card follows its blocker onto hold, unless the + * maintainer said otherwise on the card; + * - this card is `pm:on-hold` and NONE of the open cards it waits on is — + * reported with no default, because which side is stale is a reading of + * the hold comment, not of two labels. A held card with at least one held + * blocker is consistent and silent, whatever its other blockers are. + * + * A blocker that is closed, in another repo, or whose labels could not be read + * is not judged here (a closed one is H19's subject). + * + * @param {object} issue — an OPEN issue, the candidate blocked card. + * @param {number[]|undefined} blockers — its entry in `blockersByDependent`. + * @param {Map} openByNumber — the open listing, by card number. + */ +export function h79HoldMismatch(issue, blockers, openByNumber) { + if (!issue || issue.pull_request || !Array.isArray(issue.labels)) return null; + const open = (blockers ?? []) + .map((number) => openByNumber?.get?.(number)) + .filter((blocker) => blocker && Array.isArray(blocker.labels)); + if (open.length === 0) return null; + const onHold = (card) => labelNames(card).includes('pm:on-hold'); + const held = open.filter(onHold); + const name = (cards) => { + const shown = cards.slice(0, BLOCKING_DEPENDENT_LIST_CAP); + const more = cards.length > shown.length ? ` +${cards.length - shown.length} more` : ''; + return `${shown.map((card) => `#${card.number}`).join(', ')}${more}`; + }; + if (!onHold(issue)) { + if (held.length === 0) return null; return ( - `targeted by ${dependents.length} open card(s)' \`Blocked-by:\` line, body or comment ` + - `(${named}${more}), but ` + - 'NOT carrying `pm:blocking` — a real unblocker the selection order cannot see. The label is ' + - 'the derived cache that makes a card outrank everything but `priority:p0`; without it this ' + - 'card competes on age alone while the cards waiting on it cannot start. Report-only: the ' + - 'remedy is the triage sweep\'s derivation pass applying the label, never a hand-applied one.' + `HOLD MISMATCH: this card is not \`pm:on-hold\` while ${held.length} open card(s) its ` + + `\`Blocked-by:\` line names ${held.length === 1 ? 'is' : 'are'} (${name(held)}). A blocker and the ` + + 'cards it blocks hold together: by default the blocked card follows its blocker onto hold — ' + + '`pm:on-hold` with its own machine-fireable `Restart-when:` line — unless the maintainer said ' + + 'otherwise on the card. Report-only: the daily scan reports it, ⛔ never a label written from ' + + 'this script.' + + INDEX_SCOPE_NOTE ); } - return null; + if (held.length > 0) return null; + return ( + `HOLD MISMATCH, the reverse way: this card is \`pm:on-hold\` while none of the ${open.length} open ` + + `card(s) its \`Blocked-by:\` line names is (${name(open)}). Either the hold or the line is out of ` + + 'date, and two labels cannot say which: read the hold comment. ⛔ No default in this direction — ' + + 'the daily scan reports it, and the maintainer\'s word on the card decides.' + + INDEX_SCOPE_NOTE + ); } /** - * H15 — the oldest open, UNASSIGNED `pm:blocking` card, or null. + * The mutual blocks and cycles among the indexed `Blocked-by:` edges: one + * entry per group of two or more cards that each (transitively) wait on every + * other one — a strongly connected group of the waits-on graph. * - * ## No threshold constant, deliberately + * A group is reported ONCE, with the shortest cycle through its lowest card + * spelled out, rather than once per rotation or per member: the same cycle + * read from each of its cards is one finding, and a row per reading would bury + * it under its own copies. * - * Every other aged item here (H10/H11/H12/H13) answers "has this been - * abandoned?", and a threshold is what turns silence into an alarm. This row - * answers a different question — "is the lane taking blocking cards first?" — - * and the honest answer is a NUMBER, every run, for the reader to judge. A - * threshold would re-introduce exactly the judgement call the row exists to - * hand over, and would go quiet on the days the board is worst behaved but - * still under it. So: unconditional, one row, no constant. Nothing reddens - * (nothing in this file ever does). + * Iterative on purpose — no recursion to exhaust on a long chain — and total: + * a self-reference never reaches the index, so a group has two members at + * least. * - * ## The age is the CARD's, not the label's, and says so - * - * `created_at`, the same quantity the selection order's own within-rank - * tie-break reads (同级按卡龄). The label's age would be the sharper number - * and is not available: it lives in a per-card timeline fetch this sweep - * deliberately never makes for THIS population (the H2 comment fetch is one - * exception and is confined to candidates; H59 buys a timeline page, and is - * confined to the handful of cards a merged PR's body names without a keyword). - * Reporting card age and NAMING it as card age - * beats reporting a number whose meaning the reader has to guess. + * @param {Map} index — from `buildBlockingIndex`. + * @returns {{ members: number[], path: number[] }[]} `members` ascending; + * `path` starts and ends at `members[0]`, each step reading "waits on". + * Groups ascending by their lowest member. + */ +export function blockingCycles(index) { + const waitsOn = blockersByDependent(index); + const nodes = [...waitsOn.keys()].sort((a, b) => a - b); + const order = new Map(); + const low = new Map(); + const onStack = new Set(); + const stack = []; + const groups = []; + let counter = 0; + for (const root of nodes) { + if (order.has(root)) continue; + const work = [{ node: root, next: 0 }]; + order.set(root, counter); + low.set(root, counter); + counter++; + stack.push(root); + onStack.add(root); + while (work.length > 0) { + const frame = work[work.length - 1]; + const edges = waitsOn.get(frame.node) ?? []; + if (frame.next < edges.length) { + const to = edges[frame.next++]; + // A target nothing waits FROM has no outgoing edge and sits on no cycle. + if (!waitsOn.has(to)) continue; + if (!order.has(to)) { + order.set(to, counter); + low.set(to, counter); + counter++; + stack.push(to); + onStack.add(to); + work.push({ node: to, next: 0 }); + } else if (onStack.has(to)) { + low.set(frame.node, Math.min(low.get(frame.node), order.get(to))); + } + continue; + } + work.pop(); + if (work.length > 0) { + const parent = work[work.length - 1].node; + low.set(parent, Math.min(low.get(parent), low.get(frame.node))); + } + if (low.get(frame.node) === order.get(frame.node)) { + const members = []; + for (;;) { + const member = stack.pop(); + onStack.delete(member); + members.push(member); + if (member === frame.node) break; + } + if (members.length > 1) groups.push(members.sort((a, b) => a - b)); + } + } + } + groups.sort((a, b) => a[0] - b[0]); + return groups.map((members) => { + // The shortest cycle through the lowest member, inside the group only. + const inside = new Set(members); + const start = members[0]; + const from = new Map(); + const queue = [start]; + let closed = null; + for (let head = 0; head < queue.length && closed === null; head++) { + const at = queue[head]; + for (const to of waitsOn.get(at) ?? []) { + if (!inside.has(to)) continue; + if (to === start) { + closed = at; + break; + } + if (from.has(to)) continue; + from.set(to, at); + queue.push(to); + } + } + const path = [start]; + for (let at = closed; at !== null && at !== start; at = from.get(at)) path.push(at); + // Walked back from the closing card, so everything after the start is reversed. + return { members, path: [start, ...path.slice(1).reverse(), start] }; + }); +} + +/** + * H80 — one row per group `blockingCycles` finds, attached to the group's + * lowest-numbered card so it links, sorts and truncates like every other row. * - * An unreadable `created_at` sorts as maximally old rather than being skipped - * — the #4690 direction the whole file keeps: a value that cannot be read must - * surface, never quietly drop out of a "the oldest is…" claim. + * Every member of a group has an outgoing edge, so each is a DEPENDENT and is + * in the open listing the index was built from; the lowest one is the row's + * subject. A two-card group is named a mutual block, a larger one a cycle. * - * @param {object[]} issues — the open listing. - * @returns {{ issue: object, message: string } | null} + * @param {Map} index — from `buildBlockingIndex`. + * @param {Map} openByNumber — the open listing, by card number. + * @returns {{ issue: object, message: string }[]} */ -export function h15OldestUnclaimedBlocking(issues, nowMs = Date.now()) { - const candidates = []; - let blockingTotal = 0; - for (const issue of issues ?? []) { - if (!labelNames(issue).includes('pm:blocking')) continue; - blockingTotal++; - if ((issue.assignees ?? []).length > 0) continue; - const created = Date.parse(issue.created_at ?? ''); - candidates.push({ +export function h80BlockingCycleRows(index, openByNumber) { + const rows = []; + for (const { members, path } of blockingCycles(index)) { + const issue = members.map((number) => openByNumber?.get?.(number)).find(Boolean); + if (!issue) continue; + const shown = members.slice(0, BLOCKING_DEPENDENT_LIST_CAP); + const more = members.length > shown.length ? ` +${members.length - shown.length} more` : ''; + const chain = path.map((number) => `#${number}`).join(' → '); + const head = + members.length === 2 + ? `MUTUAL BLOCK: #${members[0]} and #${members[1]} each name the other in a \`Blocked-by:\` line` + : `BLOCKING CYCLE among ${members.length} open cards (${shown.map((n) => `#${n}`).join(', ')}${more})`; + rows.push({ issue, - ageHours: Number.isFinite(created) ? (nowMs - created) / 3_600_000 : null, + message: + `${head} — ${chain}, each arrow reading 「waits on」. No close can release a card in it: every ` + + 'one waits on a card that waits on it, so each reads as a well-formed block with an open ' + + 'target. One of these lines is not a real wait. Cards the fleet files for one topic block each ' + + 'other only when they edit the same file, and an order of preference is a list on the epic, ' + + '⛔ not a `Blocked-by:` chain. Report-only: the daily scan reports it and the owning seat ' + + 'removes or re-points the line that is not a wait, ⛔ never a label written from this script.' + + INDEX_SCOPE_NOTE, }); } - if (candidates.length === 0) return null; - candidates.sort( - (a, b) => - (b.ageHours ?? Infinity) - (a.ageHours ?? Infinity) || a.issue.number - b.issue.number, - ); - const [oldest] = candidates; - const age = - oldest.ageHours === null - ? 'an unreadable `created_at` (sorted as maximally old — a timestamp that cannot be read must ' + - 'surface, never drop out of an "oldest is…" claim)' - : `open ~${Math.round(oldest.ageHours)}h`; - return { - issue: oldest.issue, - message: - `oldest UNCLAIMED \`pm:blocking\` card: ${age}, ${candidates.length} of ${blockingTotal} open ` + - '`pm:blocking` card(s) unassigned. The lane selection order puts `pm:blocking` second only to ' + - '`priority:p0`, so an unclaimed one aging while fresher cards are picked is selection-order ' + - 'drift — visible here by name instead of only in a seat\'s memory. Age is the CARD\'s ' + - '(`created_at`, the same quantity the order\'s within-rank tie-break reads), not the label\'s: ' + - 'that would need a per-card timeline fetch this sweep never makes for this population. ' + - 'Visibility row — no ' + - 'threshold, it reports unconditionally, and like everything here it is patrol input, not a verdict.', - }; + return rows; } // --------------------------------------------------------------------------- @@ -4343,7 +4423,7 @@ export function h15OldestUnclaimedBlocking(issues, nowMs = Date.now()) { * * ⛔ It must not be "fixed" by dating the conflict from a per-PR timeline * fetch. That is an extra request per candidate to sharpen a report-only row, - * and this sweep declines that trade everywhere else it arises — H15 declines + * and this sweep declines that trade everywhere else it arises — H11 declines * it by name for the age of a label. The proxy is named in the finding text so * the reader knows which quantity they are being shown. * @@ -4788,10 +4868,10 @@ export function h17IndexRows(entries, isTracked) { // The full rationale, the measured unrunnability it answers and the two halves // of its incompleteness are in the file header. What lives here is the ruling's // own bytes, the gathering pass, and the one thing a reader must not get wrong: -// this section asks the REVERSE question H14 asks, over the SAME index. H14 -// asks whether a card carrying `pm:blocking` is targeted by anything; ④ asks +// this section reads the SAME index the relation rows (H78–H80) read. They +// ask what a blocker and the cards it blocks owe each other; ④ asks // which cards in the DECISION inbox are targeted by anything. Same edges, two -// populations — so there is exactly one index, and no second parser for the +// questions — so there is exactly one index, and no second parser for the // line (`buildBlockingIndex` stays the only builder, `blockedByTargets` the // only parser it uses). // --------------------------------------------------------------------------- @@ -4814,7 +4894,7 @@ export const INSTRUCTION_FOUR_RULING = * * No request of its own and no second listing: `issues` is the unscoped * open-issue listing the sweep already holds, and `index` is the very - * `buildBlockingIndex` map H14 is judged against. ④ costs this patrol one + * `buildBlockingIndex` map H78–H80 read. ④ costs this patrol one * `Map.get` per decision card. * * The inbox label is `DECISION_INBOX_LABEL`, deliberately NOT a second @@ -4944,9 +5024,9 @@ export function h18RetriageAged(issue, nowMs = Date.now()) { // --------------------------------------------------------------------------- // H19 — a block that OUTLIVED its blocker. // -// The one question about a block that nothing here asked. Two items already -// read the `Blocked-by:` line and NEITHER expires a block: H4 asks whether the -// line EXISTS, H14 asks the REVERSE index (does anything target THIS card). +// The one question about a block that nothing here asked. H4 already read +// the `Blocked-by:` line and does NOT expire a block: it asks whether the +// line EXISTS, and the reverse index asks what targets THIS card. // The question that actually ENDS a block — is the issue it names still open? // — had no reader at all, so a block outlives its blocker in complete silence: // well-formed line, correct label, no row anywhere. @@ -4992,7 +5072,7 @@ export function h18RetriageAged(issue, nowMs = Date.now()) { // 械、零判断)」), and neither is a thing this file could perform: they read the // card's conversion-comment history and its merged-PR timeline. So this row // surfaces the CANDIDATE and the unlock sweep releases it. ⛔ Never a label -// written from this script — the same posture H14 holds for `pm:blocking`. +// written from this script. // --------------------------------------------------------------------------- /** @@ -5540,7 +5620,10 @@ export function h19BlockOutlivedBlocker(issue, resolutions, ownerRepo = OWNER_RE 'all, so this is ⛔ NOT reported as a full discharge: unread is not closed and it is not ' + 'absent either (#4690), and a RE-PARK is exactly the shape that parks a LIVE blocker in a ' + 'comment (#11747).' - : ' Every target it names is closed: nothing this card declared a wait on is still running.'; + : ' Every target it names is closed: nothing this card declared a wait on is still running. ' + + 'That is the FULL discharge the daily scan acts on: after the installable check it returns ' + + 'the card to `pm:queue` with one comment, or rewrites the line to the next real blocker ' + + 'when one remains.'; const alsoUnresolved = unresolved.length === 0 ? '' @@ -5549,8 +5632,8 @@ export function h19BlockOutlivedBlocker(issue, resolutions, ownerRepo = OWNER_RE return ( `\`pm:blocked\` while ${closed.length} of ${judgedCount} \`Blocked-by:\` target(s) — ${carrier} — ` + `${closed.length === 1 ? 'is' : 'are'} CLOSED (${namedTargets(closed)}): the block has ` + - 'outlived its blocker. Nothing else here asks this question — H4 asks whether the line EXISTS, H14 ' + - 'asks the REVERSE index — so an expired block sits with a well-formed line, a correct label and no ' + + 'outlived its blocker. Nothing else here asks this question — H4 asks only whether the line EXISTS ' + + '— so an expired block sits with a well-formed line, a correct label and no ' + 'row anywhere: one measured card sat ~4.5h past its blocker\'s close and was found only by a human ' + 'walking the graph, another was released only by a manual triage pass.' + rest + @@ -5616,7 +5699,7 @@ export function h19BlockOutlivedBlocker(issue, resolutions, ownerRepo = OWNER_RE // The adjacent rows each decline it, for a good reason of its own: // H2 assignee with NO claim comment — here the claim comment is present // and complete, which is exactly the point. -// H4 / H14 `Blocked-by:` — not a blocked card. +// H4 `Blocked-by:` — not a blocked card. // H9 `pm:on-hold` without `Restart-when:` — not held. // H8 a MERGED PR while still dispatched — nothing merged; nothing ran. // Nothing asked whether a card labelled `pm:dispatched` is actually BEING @@ -6085,7 +6168,7 @@ export function h20DispatchedNoBranchRef(issue, claim, refStates, nowMs = Date.n const remedy = ' Report-only: the remedy is a DISPATCH or a withdrawn claim, ⛔ never a label written from this ' + - 'script — the same posture H14 holds for `pm:blocking` and H19 for a released block.'; + 'script — the same posture H19 holds for a released block.'; if (unreadable.length > 0) { return ( @@ -6386,18 +6469,19 @@ export function h21NegatedClosingKeyword(pr) { /** * The `pm:*` labels that are STATE CLAIMS, and therefore residue on a closed - * card. Exactly the five the #10688 census measured. + * card. The #10688 census measured five; the fifth, `pm:blocking`, left this + * set when the label was RETIRED — a retired label has no reader, this one + * included, and what is left of it on the board goes with the label object + * (a separate, deliberate PM act: see `ensure-pm-labels.sh`). * * ⚠️ This is deliberately NOT `PM_STATE_LABELS` (H13's), and the two must not * be unified on the strength of the similar name. H13 asks "does any label make * this card visible to a named reader?", so its list carries `finding`, - * `needs-user-decision`, `pm:epic` and `pm:seat` and deliberately OMITS - * `pm:blocking`. H22 asks a different question — "does this label CLAIM work is - * in flight?" — and the answers diverge in both directions: `pm:blocking` is - * such a claim (it is what the lane selection order ranks on) while `finding` - * and `needs-user-decision` are perfectly good states for a closed card to have - * ended in. Sharing one list would make H22 report every closed finding card on - * the board and miss the blocking-cache residue entirely. + * `needs-user-decision`, `pm:epic` and `pm:seat`. H22 asks a different + * question — "does this label CLAIM work is in flight?" — and the answers + * diverge: `finding` and `needs-user-decision` are perfectly good states for a + * closed card to have ended in. Sharing one list would make H22 report every + * closed finding card on the board. * * Three `pm:*` labels are excluded here because they are not claims that work * is in flight: @@ -6416,7 +6500,6 @@ export const PM_RESIDUE_LABELS = [ 'pm:queue', 'pm:blocked', 'pm:on-hold', - 'pm:blocking', // `pm:awaiting-maintainer` is residue on a closed card for the same reason // `pm:on-hold` is: it claims an action is still OWED. It joins the set with // the state itself (#11196 fix 5) rather than waiting for a census the way @@ -6830,14 +6913,13 @@ export const AWAITING_MAINTAINER_EXCLUSIVE_LABELS = [ * and `pm:seat`, none of which is a position on the * work state machine. * `PM_RESIDUE_LABELS` (H22) "does this label CLAIM work is in flight?" — - * so it carries `pm:blocking` (a derived priority - * cache, not a state) and drops `needs-user-decision` - * (a fine state to close in). + * so it drops `needs-user-decision` (a fine state + * to close in). * `PM_EXCLUSIVE_STATE_LABELS` (H29) "is this a position the card can be * IN, such that two of them contradict?" — identity * stickers (`pm:seat`, `pm:epic`) legally coexist - * with any state and are out; `pm:blocking` and - * `pm:retriage` are annotations ON a state and are + * with any state and are out; `pm:retriage` is an + * annotation ON a state and is * out; `finding` is a card KIND rather than a * position and is out. `needs-user-decision` is IN, * because a card awaiting a ruling is somewhere, and @@ -7619,6 +7701,109 @@ export function h28StaleBodyBlockerLine(issue, resolutions, commentBodies, owner ); } +// --------------------------------------------------------------------------- +// H77 — a `pm:blocked` card whose `Blocked-by:` line names NO OPEN TARGET. +// +// The gap between H4 and H19. H4 asks whether a line EXISTS and is silent the +// moment one does; H19 asks whether a target has closed — for a PR, merged — +// and founds nothing on anything else. Between them sits a card that carries a +// line and waits on nothing nameable: +// +// - the line names no card or PR at all (a sentence after the key, or only +// the card's own number) — a value with no ref resolves to an EMPTY target +// set, which both rows read as "nothing to say"; +// - every target it names is a PR that closed UNMERGED — H19 rightly refuses +// to read an abandoned PR as a release, so the card sits behind a PR that +// will never merge. +// +// Either way no close will ever fire the unlock, and every row here was silent +// on it. A block is a wait on an OPEN card or an UNMERGED PR and the line is +// its only source, so a line that names neither is the half-state. +// +// FREE: the resolutions and the comment bodies the liveness loop already holds. +// ⛔ It never double-reports. A card with no line is H4's, and a card with a +// closed-as-done or unreadable judged target is H19's: this row asks both +// first and stands down for either, by calling them rather than re-deriving +// what they would say. +// --------------------------------------------------------------------------- + +/** + * H77 — null when the line names an open target, or when H4 or H19 already + * owns the card; else the finding sentence. + * + * ⛔ No angle-bracket fragment and no tracker number in the sentence: it is + * rendered into a GitHub issue body. + * + * @param {object} issue — an OPEN issue. + * @param {{ key: string, number: number, local: boolean, + * state: 'open'|'closed'|'unresolved', unmerged?: boolean }[]} resolutions — + * this card's targets, resolved: H19's own input. + * @param {string[]|null|undefined} commentBodies — as gathered for the liveness + * read. `null` is a thread that could not be read, and the row says so + * rather than asserting the comment channel is empty. + * @param {string} [ownerRepo] — as for H19: the repo the resolutions were + * keyed against. + */ +export function h77BlockNamesNoOpenTarget(issue, resolutions, commentBodies, ownerRepo = OWNER_REPO) { + if (!needsBlockerLiveness(issue)) return null; + // No line in either channel is H4's row, with H4's remedy. + if (h4BlockedNoBlockedBy(issue, commentBodies) !== null) return null; + const rows = resolutions ?? []; + if (rows.some((r) => r?.state === 'open')) return null; + // A closed-as-done or an unreadable judged target is H19's row. + if (h19BlockOutlivedBlocker(issue, rows, ownerRepo) !== null) return null; + + // What is left carries a line, names nothing open, and nothing it names + // closed as done. The carrier split is H19's own, so the two agree on which + // targets this card's authoritative channel states. + const bodyKeys = blockerChannelKeys(issue?.body, issue, ownerRepo); + const carries = (r) => bodyKeys.size === 0 || bodyKeys.has(r.key); + const judged = rows.filter(carries); + const archive = rows.filter((r) => !carries(r)); + // Unreachable from the sweep (the two guards above leave only unmerged PRs in + // the judged set); a row of any other shape is one this predicate cannot + // vouch for, and silence is the direction that never invents a verdict. + if (judged.some((r) => !(r.state === 'closed' && r.unmerged === true))) return null; + if (rows.length > 0 && judged.length === 0) return null; + + const where = hasBlockedByLine(issue?.body) ? 'its body' : 'a comment'; + const what = + judged.length === 0 + ? `the line is there (in ${where}) and names no card or PR other than this card itself — ` + + 'nothing after the key is a reference to another card' + : `every target it names is a PR that closed UNMERGED (${namedTargets(judged)}) — an abandoned PR ` + + 'lands nothing, so its close is never a release, and it will never merge'; + const unreadArchive = archive.filter((r) => r.state === 'unresolved'); + const archiveNote = + archive.length === 0 + ? '' + : ` A further ${archive.length} target(s) reach this card only through the comment archive ` + + `(${namedTargets(archive)}): none of them is open` + + (unreadArchive.length > 0 + ? `, and ${unreadArchive.length} could not be read this sweep — unread, not closed` + : '') + + '. The body states its own set, so they change nothing here.'; + const threadNote = + commentBodies === null + ? ' ⚠️ This card\'s comment thread could NOT be read this sweep, so a target parked in a comment ' + + 'is unread, not absent: the row reports what the body says.' + : ''; + return ( + `\`pm:blocked\` and its \`Blocked-by:\` line names NO OPEN TARGET: ${what}. So the card waits on ` + + 'nothing nameable and no close can ever release it — H4 is silent because a line exists, and H19 ' + + 'because nothing it names closed as done. A block is a wait on an OPEN card or an UNMERGED PR, and ' + + 'the line is its only source.' + + archiveNote + + threadNote + + ' Remedy, by what the card is really waiting for: another card or PR ⇒ rewrite the line to name ' + + 'it; the maintainer\'s own action ⇒ `pm:awaiting-maintainer` with a `Maintainer-action:` line; his ' + + 'product choice ⇒ the decision box, with options and a recommendation; a platform release ⇒ ' + + '`pm:on-hold` with a `Restart-when:` line; nothing any more ⇒ back to `pm:queue`. Report-only: the ' + + 'daily scan reports it and the owning seat makes the move, ⛔ never a label or a line written from ' + + 'this script.' + ); +} + // --------------------------------------------------------------------------- // H32 — a HELD seat sitting idle over a non-empty lane queue (#11706). // @@ -9057,8 +9242,8 @@ export function h37FamilyMemberDrift(folds, openByNumber, closedByNumber) { * this row UNDER-reports: a seat whose post was silently bumped by a label write * reads as fresher than it is and goes unreported. Named rather than fixed, * because the alternative — a per-post timeline fetch on every seat, every sweep - * — is a per-card event read this file declines everywhere else (H15, H16 and - * H35 all refuse the same shape by name), and the residual error is one label + * — is a per-card event read this file declines everywhere else (H16 and + * H35 both refuse the same shape by name), and the residual error is one label * write on a surface whose labels are essentially static. * * @param {{ updated_at?: string }} seat @@ -14790,7 +14975,7 @@ export function h58QueuedRulingRow(issue, commentBodies) { // status (#17374): a failed read is UNJUDGED and counted. // // ⚠️ This is the FIRST per-card timeline fetch in this file, and the rows that -// decline one by name (H11/H15's label age, H18/H13's `updated_at` proxy, +// decline one by name (H11's label age, H18/H13's `updated_at` proxy, // H55's entry instant) still decline it — their // notes are narrowed to say so rather than deleted. The fetch is bought here // for a population that is at most a handful of cards a sweep, never for the @@ -15498,6 +15683,24 @@ export function ruledRecords(body) { return out; } +/** + * The ruling record that GOVERNS a body: the one with the newest readable + * stamp, else the first record written; null when the body carries none. + * + * ONE spelling of that rule, read by H73 (is the governing ruling's exit owed?) + * and by H81 (is there a governing ruling at all?), so the two rows cannot come + * to disagree about which ruling a card is under. + * + * @param {string} body + * @returns {{ id: string, at: number|null } | null} + */ +export function governingRuledRecord(body) { + const records = ruledRecords(body); + if (records.length === 0) return null; + const stamped = records.filter((r) => r.at !== null); + return stamped.length > 0 ? stamped.reduce((a, r) => (r.at > a.at ? r : a)) : records[0]; +} + /** * Is this ruling id named on the body's `Prior rulings on this card:` line, or * on the list lines directly under it? Fences stripped, like the record itself. @@ -15538,10 +15741,8 @@ export function h73SpeaksAbout(issue) { */ export function h73RuledCardStillInBox(issue, nowMs = Date.now()) { if (!h73SpeaksAbout(issue)) return null; - const records = ruledRecords(issue.body); - if (records.length === 0) return null; - const stamped = records.filter((r) => r.at !== null); - const governing = stamped.length > 0 ? stamped.reduce((a, r) => (r.at > a.at ? r : a)) : records[0]; + const governing = governingRuledRecord(issue.body); + if (!governing) return null; if (priorRulingNamesId(issue.body, governing.id)) return null; const ageHours = governing.at === null ? null : (nowMs - governing.at) / 3_600_000; if (ageHours !== null && ageHours <= RULED_IN_BOX_STALE_HOURS) return null; @@ -15568,6 +15769,99 @@ export function h73RuledCardStillInBox(issue, nowMs = Date.now()) { ); } +// --------------------------------------------------------------------------- +// H81 — a question in the decision box that nobody has answered. +// +// A card waiting on the maintainer's product choice goes where he reads +// decisions — `needs-user-decision`, with options and a recommendation — and +// ⛔ never parks under `pm:blocked` or `pm:awaiting-maintainer`. The other half +// of that rule is this row: the daily scan LISTS the questions that have been +// open more than `DECISION_UNANSWERED_STALE_DAYS`, so a question does not sit +// in the box unseen because nothing ever re-surfaces it. +// +// The population is H73's, read the other way. H73 reports a card that HAS a +// governing ruling and is still in the box (the exit is owed by a lane seat); +// this row reports a card that has NONE (the answer is owed by the maintainer). +// One shared reader decides which ruling governs (`governingRuledRecord`), so +// a card is exactly one of the two and never both. A card that re-entered the +// box with a NEW question — its `Prior rulings on this card:` line names the +// earlier ruling — is unanswered again, and is this row's. +// +// ## Which age, and why it is the card's +// +// When a card ENTERED the box is the instant its label was applied, which +// lives in a per-card event read this sweep buys for no row of this kind (H11 +// and H18 decline the same read by name). So the age is counted from the +// card's `created_at` — and, for a re-entered card, from the newest earlier +// ruling its body records, which is a floor on the re-entry. The error +// direction is stated on the row: a card filed long before it entered the box +// reads OLDER than its question is. That over-reports in one shape and +// under-reports in none, and the row prints the last-touched time beside the +// age so a reader can see the shape at a glance. +// +// ⛔ `updated_at` is deliberately NOT the clock: any comment bumps it, so a +// question that a seat nudges every other day would never list — the silence +// this row exists to end. An unreadable age FIRES, never reads as fresh. +// +// FREE — one label read, one body read and two timestamps on a row the +// unscoped listing already holds. Report-only: ⛔ no seat answers for the +// maintainer and no script moves the card. Band `stall`. +// --------------------------------------------------------------------------- + +/** H81's threshold, in days: how long a question may sit unanswered unlisted. */ +export const DECISION_UNANSWERED_STALE_DAYS = 3; + +/** + * H81 — null when the card is not an unanswered question past the threshold, + * else the finding sentence. + * + * ⛔ No angle-bracket fragment and no tracker number in the sentence: it is + * rendered into a GitHub issue body, and the card it is about is the row's own + * link. + * + * @param {object} issue — a row of the unscoped open listing. + */ +export function h81DecisionUnanswered(issue, nowMs = Date.now()) { + if (!h73SpeaksAbout(issue)) return null; + const governing = governingRuledRecord(issue.body); + // A governing ruling is an ANSWER: what the card owes then is its exit, H73's row. + const reentered = governing !== null && priorRulingNamesId(issue.body, governing.id); + if (governing !== null && !reentered) return null; + + const created = Date.parse(issue.created_at ?? ''); + const floors = [created, reentered ? governing.at : null].filter((at) => Number.isFinite(at)); + const since = floors.length > 0 ? Math.max(...floors) : null; + const ageDays = since === null ? null : (nowMs - since) / 86_400_000; + if (ageDays !== null && ageDays <= DECISION_UNANSWERED_STALE_DAYS) return null; + + const countedFrom = + reentered && Number.isFinite(governing.at) && since === governing.at + ? 'counted from the newest earlier ruling its `Prior rulings on this card:` line names — the card ' + + 're-entered the box with a new question after it' + : 'counted from the day the card was filed'; + const age = + ageDays === null + ? 'for a time this sweep could not read (no readable `created_at` — an unreadable age must not ' + + 'read as fresh)' + : `~${Math.floor(ageDays)} day(s) (threshold ${DECISION_UNANSWERED_STALE_DAYS}), ${countedFrom}`; + const touched = Date.parse(issue.updated_at ?? ''); + const lastTouched = Number.isFinite(touched) + ? `last touched ~${Math.max(0, Math.round((nowMs - touched) / 3_600_000))}h ago` + : 'last-touched time unreadable'; + return ( + `\`${DECISION_INBOX_LABEL}\` and no ruling recorded on the card: this question has been open ${age}; ` + + `${lastTouched}. The age is the CARD's, not the label's: when a card entered the box lives in a ` + + 'per-card event read this sweep does not buy, so a card filed long before it entered the box reads ' + + 'older than its question is — the last-touched time rides beside it for that reason. The answer is ' + + 'the maintainer\'s alone: ⛔ no seat answers for him and no script moves the card. What a seat owes ' + + 'is the path to him — the card in the decision box with its options and a recommendation, and the ' + + 'decision thread the coordinator opens for it; the daily scan lists this row to him. Report-only: ' + + '⛔ never a label written from this script. Boundaries: a card whose body carries a governing ' + + `\`${RULED_LINE_KEY}:\` record is ANSWERED and is H73's, never this row's; a closed card and a pull ` + + 'request are out.' + ); +} + // --------------------------------------------------------------------------- // The stale-`finding` screen — the rule H63 reads (#16904) // @@ -18012,7 +18306,6 @@ export const H67_QUOTE_LIMIT = 220; */ export const H67_SELECTION_ORDER_LABELS = Object.freeze([ 'priority:p0', - 'pm:blocking', 'priority:p1', 'priority:p2', 'priority:p3', @@ -18966,11 +19259,10 @@ export function summaryLine(counts, findingCount) { const candidates = counts.conflictCandidates ?? 0; const held = counts.holdProbed ?? 0; const holdCandidates = counts.holdCandidates ?? 0; - // The third `read X of Y` pair, and the one with a consequence the other two - // do not have: a shortfall here does not merely leave rows out, it SILENCES - // H14's stale direction (see the predicate). A reader seeing a quiet stale - // section needs this number to tell "the cache is coherent" from "the sweep - // declined to judge it". + // The third `read X of Y` pair. A shortfall here leaves EDGES out of the + // reverse index: every relation row (H78–H80, instruction ④) is a claim about + // edges in hand, so none is suspended — but a reader needs this number to tell + // "no card waits on it" from "the thread that says so was not read". const fbProbed = counts.fallbackProbed ?? 0; const fbCandidates = counts.fallbackCandidates ?? 0; // H9's pair (#10403), same shape as H17's over the same fetches but for the @@ -19062,7 +19354,7 @@ export function summaryLine(counts, findingCount) { const refBeyond = counts.refBeyond ?? 0; return ( `check-half-states: swept ${counts.issues} open pm-/p0-labeled issue(s), ${counts.unscoped} open ` + - `issue(s) in the unscoped pass (H13–H15, H18), ${counts.prs} open PR(s) ` + + `issue(s) in the unscoped pass (H13, H18, H78–H81), ${counts.prs} open PR(s) ` + `(merge state read on ${probed} of ${candidates} H16 candidate(s)) ` + `and ${counts.merged} recently-merged PR(s) in ${counts.repo} — ${findingCount} half-state(s) found. ` + // H8's window disclosure (#13499). The TRUNCATED half is the load-bearing @@ -19145,7 +19437,7 @@ export function summaryLine(counts, findingCount) { } ` + `Hold comments read on ${held} of ${holdCandidates} H17 candidate(s). ` + `\`Blocked-by:\` comment fallback read on ${fbProbed} of ${fbCandidates} candidate(s)` + - `${fbProbed < fbCandidates ? " — H14's stale direction is SUSPENDED for this sweep (the index is known incomplete)" : ''}. ` + + `${fbProbed < fbCandidates ? ' — the reverse index is MISSING the edges those threads carry (H78–H80 and instruction ④ read edges in hand)' : ''}. ` + `\`Restart-when:\` hold comments read on ${rwProbed} of ${rwCandidates} H9 candidate(s)` + `${rwProbed < rwCandidates ? " — each unread thread fires its own card's H9 row, never dropped" : ''}. ` + `Awaiting-maintainer entries (H55): ${awaitingLegacy} open \`${AWAITING_MAINTAINER_LABEL}\` card(s) last ` + @@ -19593,7 +19885,7 @@ export const SUMMARY_CLAUSE_ANCHORS = [ ['h23Window', "H23's commit window is a"], ['openListings', 'The open listings (H1–H18 inventory, H13 unscoped pass, open PRs) is an '], ['h17Holds', 'Hold comments read on '], - ['h14Fallback', '`Blocked-by:` comment fallback read on '], + ['blockedByFallback', '`Blocked-by:` comment fallback read on '], ['h9Restart', '`Restart-when:` hold comments read on '], ['h55Awaiting', 'Awaiting-maintainer entries (H55): '], ['h74Audit', 'First-touch audits (H74): '], @@ -19803,7 +20095,7 @@ export function renderTriggerIndex(index, { markdown = false } = {}) { * population is the maintainer's answer queue (1–9 cards across the boards this * was measured on), so the ceiling this section keeps is the PER-ROW dependent * cap, and it reuses `BLOCKING_DEPENDENT_LIST_CAP` rather than inventing a - * second number for the same fan-out H14 already bounds. + * second number for the same fan-out H78–H80 already bound. * * @param {{ rows: Array<{ issue: object, dependents: number[] }>, inbox?: number, * unmeasured?: number }} [inventory] — from `decisionDependentIndex`, plus @@ -19824,7 +20116,7 @@ export function renderDecisionDependents(inventory, { markdown = false } = {}) { `\`${DECISION_INBOX_LABEL}\` card that at least one OPEN card's \`Blocked-by:\` line ` + `names, and ⛔ no priority label is written for it. The standing instruction this ` + `discharges, verbatim: 「${INSTRUCTION_FOUR_RULING}」 It is one lookup over the same ` + - `reverse index H14 is judged against — no second channel and no second parser (#17968).`, + `reverse index the blocking-relation rows read — no second channel and no second parser (#17968).`, '', ); @@ -19858,9 +20150,9 @@ export function renderDecisionDependents(inventory, { markdown = false } = {}) { `MEASURED: the flag count alone is a number that ran, and therefore reads as complete.`; const scope = `Population scope: dependent BODIES are read from every open issue in this repo (the ` + - `unscoped listing); dependent COMMENTS only from open \`pm:blocked\` / \`pm:blocking\` cards ` + + `unscoped listing); dependent COMMENTS only from open \`pm:blocked\` cards ` + `whose body carries no \`Blocked-by:\` line. A dependent that states the wait in a comment ` + - `and carries neither label, and any dependent in a sibling repo, is outside this reading — ` + + `and does not carry that label, and any dependent in a sibling repo, is outside this reading — ` + `unread, not absent.`; head.push('', ...(markdown ? [`_${count}_`, '', `_${notMeasured}_`, '', `_${scope}_`] : [` ${count}`, ` ${notMeasured}`, ` ${scope}`])); @@ -20070,7 +20362,9 @@ export const UNREGISTERED_FAMILY_BAND = 'unregistered'; * the only reader able to tell a stripped gate from an ungated * card cannot be the row that arrival order eats. * stall the card is stopped and no later sweep frees it: a block that - * outlived or mis-names its blocker (H19/H26/H28), a dispatch that + * outlived or mis-names its blocker (H19/H26/H28), one that names + * no open target or waits in a cycle (H77/H80), a question the + * maintainer has not answered (H81), a dispatch that * never reached a branch or whose claimant is gone (H20/H27/H33), * a PR that cannot land (H12/H16/H36), a governed PR that nobody * was asked to look at (H43), a seat or lane not moving @@ -20079,8 +20373,9 @@ export const UNREGISTERED_FAMILY_BAND = 'unregistered'; * state the board contradicts itself on a live card, and the repair is * on the board: label pairs, claim shapes, aged states. * inventory triage's own examples of the class gate rows outrank — the - * `pm:blocking` cache (H14/H15), the seat-sticker pair (H5/H6), - * the important-parked list (H11). ⚖️ Closed-card residue (H22) + * seat-sticker pair (H5/H6), the important-parked list (H11). + * The `pm:blocking` cache pair (H14/H15) was a third example + * and is retired with its label. ⚖️ Closed-card residue (H22) * was triage's fourth example and is no longer here at all: since * #14072 it files no row, so it is a reserved-section reading * rather than the lowest-ranked row family. @@ -20435,8 +20730,6 @@ export const HALF_STATE_FAMILY_BAND = Object.freeze({ H5: 'inventory', H6: 'inventory', H11: 'inventory', - H14: 'inventory', - H15: 'inventory', // H72 is `inventory`: a census of one mailbox's recent off-table bells. Nothing // is stopped (not `stall`), and no write on the board repairs a sent comment // (not `state`) — the repair is the next bell, spelled from the table. @@ -20446,6 +20739,19 @@ export const HALF_STATE_FAMILY_BAND = Object.freeze({ // owner the ruling makes it name is missing, and the repair is one relay // `assign` on the board. ⛔ Not `stall`: an unowned PR can still land. H76: 'state', + + // The blocking relation, read from the `Blocked-by:` lines. H77 and H80 are + // `stall`, H19's band for H19's reason: a block no later sweep frees — the + // line names no open target, or the cards wait on each other. H78 and H79 + // are `state`: the board contradicts itself across two live cards (a blocker + // graded below what it blocks, a hold on one side only) and the repair is + // one write on the board. H81 is `stall`: the question moves only when the + // maintainer answers it. + H77: 'stall', + H78: 'state', + H79: 'state', + H80: 'stall', + H81: 'stall', }); const FAMILY_BAND_RANK = new Map(HALF_STATE_FAMILY_BANDS.map((b) => [b.name, b.rank])); @@ -20468,11 +20774,18 @@ function familyNumber(code) { /** * The ledger's own render ceiling, in the tradition of every other cap in this - * file. The registry holds far fewer families than this, so the cap can only + * file. The registry holds fewer families than this, so the cap can only * ever bite on a run carrying a crowd of UNREGISTERED codes — which sort into * the protected band above and therefore render before the cap can reach them. + * + * RAISED 64 → 72 with the blocking-relation rows (H77–H81): the registry had + * grown to 63 of 64 and five new families less the two retired ones (H14/H15) + * make 66, which a cap of 64 would have let TRIM REGISTERED families — the one + * thing the sentence above promises it cannot do. The pin 「the registry still + * fits inside the ledger ROW CAP」 is what caught it. The worst case was + * re-measured at the new cap; see `FAMILY_LEDGER_WORST_CASE_BYTES`. */ -export const FAMILY_LEDGER_ROW_CAP = 64; +export const FAMILY_LEDGER_ROW_CAP = 72; /** Families named inline in the trim callout before it degrades to a count. */ export const FAMILY_LEDGER_CALLOUT_CAP = 12; @@ -20483,7 +20796,7 @@ export const FAMILY_LEDGER_CALLOUT_CAP = 12; * worst case and measures it, never left as a claim. The arithmetic: * * heading + intro prose ~1.1 KB, fixed - * table rows ≤ FAMILY_LEDGER_ROW_CAP (64) × ~48 B ≈ 3.1 KB + * table rows ≤ FAMILY_LEDGER_ROW_CAP (72) × ~48 B ≈ 3.5 KB * trim callout ≤ FAMILY_LEDGER_CALLOUT_CAP (12) × ~26 B + prose * unregistered callout ≤ FAMILY_LEDGER_CALLOUT_CAP (12) × ~8 B + prose * computed-0 line ≤ registry size (38) × ~8 B + prose @@ -20493,7 +20806,9 @@ export const FAMILY_LEDGER_CALLOUT_CAP = 12; * #14072 removed H22, 38 with H45/H46 — the ROW CAP below, not the registry * size, is what bounds the table, so the measured figure still stands), * 3,754 B with enough unregistered - * codes on top to reach `FAMILY_LEDGER_ROW_CAP`. 6,000 is the declared ceiling + * codes on top to reach `FAMILY_LEDGER_ROW_CAP`. Re-measured in bytes when the + * cap rose 64 → 72: 3,025 B and 3,435 B on the 63-family registry at cap 64, + * 3,101 B and 3,777 B on the 66-family registry at cap 72. 6,000 is the declared ceiling * above both, and it is under an EIGHTH of `MARKDOWN_BODY_BUDGET` (60,000) — * and reserved out of that budget, so the headroom between the budget and * `ISSUE_BODY_LIMIT` is untouched by it. ⚠️ Those two measured figures were @@ -24585,7 +24900,7 @@ async function sweepInto(findings, seen, seenPrs, seenMerged, seenUnscoped, seen const halfState = h13DomainWithoutPmState(issue); if (halfState) findings.push([issue, 'H13', halfState]); // H18 — same population: `pm:retriage` can coexist with a label this - // sweep's label pages never fetch (e.g. `pm:blocking`) or with none at + // sweep's label pages never fetch (e.g. `needs-user-decision`) or with none at // all, so only the unscoped listing is guaranteed to see every carrier. const retriageAged = h18RetriageAged(issue); if (retriageAged) findings.push([issue, 'H18', retriageAged]); @@ -24603,6 +24918,12 @@ async function sweepInto(findings, seen, seenPrs, seenMerged, seenUnscoped, seen // a row this listing already holds — no request, no thread. const ruledInBox = h73RuledCardStillInBox(issue); if (ruledInBox) findings.push([issue, 'H73', ruledInBox]); + // H81 — the same decision card with NO answer yet, on this listing for + // H62's reason. One label read, one body read and two timestamps on a row + // this listing already holds — no request, no thread. A card is H73's or + // this row's, never both: one reader decides which ruling governs. + const unanswered = h81DecisionUnanswered(issue); + if (unanswered) findings.push([issue, 'H81', unanswered]); // H63 (#16904) — the same listing for the same reason: `finding` is not one // of the labels the label loop pages, so a carrier holding no `pm:*` state // is first visible HERE. One label read on a row this listing already @@ -24617,48 +24938,52 @@ async function sweepInto(findings, seen, seenPrs, seenMerged, seenUnscoped, seen if (seamless) findings.push([issue, 'H68', seamless]); } - // H14 + H15 — the same unscoped listing, read a second way. It is the right - // population for BOTH halves and neither label page could substitute: a - // `pm:blocking` card need carry no other label (so the label pages above can - // miss the subject), and the `Blocked-by:` lines that judge it are written by - // cards of any label at all (so they can miss the evidence). No extra fetch: - // the bodies are already in hand, which is exactly the "derived from the same - // body reads the sweep already performs" this pair was specified as. + // The `Blocked-by:` reverse index — the same unscoped listing, read a second + // way. It is the right population and no label page could substitute: the + // lines are written by cards of any label at all, so a label-scoped listing + // can miss the evidence. No extra listing: the bodies are already in hand. // - // …with ONE fetching pass in front of it, and it has to be here rather than - // in the label loop above: `pm:blocking` is not one of the labels that loop - // lists, so those cards are first visible in this listing. The gate is the - // same one H4 used, the cache is the same, and a card already gathered above - // is a no-op — so the union of the two passes is still at most one request - // per card. + // …with ONE fetching pass in front of it, for the comment channel. The gate + // is the same one H4 used and the cache is the same, so a card the label loop + // already gathered is a no-op here — this pass only pays for a `pm:blocked` + // card the label pages did not hand over, and the union of the two passes is + // still at most one request per card. for (const issue of unscoped) { if (needsBlockedByComments(issue)) await gatherBlockedByComments(issue); } // Total failure is the transport, not a board where no card parks the line // in a comment — the same #4690 judgement H16 and H17 make, and the same // predicate, deliberately shared rather than re-derived. A PARTIAL shortfall - // is a bounded gap: it stays, and it costs H14's stale direction (below) - // plus a summary-line clause, rather than the sweep. + // is a bounded gap: it stays, and it costs the index the edges those threads + // carry plus a summary-line clause, rather than the sweep. if (h16DetailPassUnreadable(stats.fallbackCandidates, stats.fallbackProbed)) { throw lastFallbackError; } const blockingIndex = buildBlockingIndex(unscoped, { comments: fallback.comments }); - const indexComplete = fallback.unreadable.size === 0; // Instruction ④ (#17968) — the SAME index, asked the decision box's question. // Here rather than beside the renderer because this is where both inputs are // in hand: the unscoped open listing and the index it just fed. No request, - // no second parser, and no widening of what H14 reads. + // no second parser, and no widening of what the index reads. if (decisions) Object.assign(decisions, decisionDependentIndex(unscoped, blockingIndex)); + + // H78 + H79 + H80 — the same index a third time, asked what a blocker and the + // cards it blocks owe each other. `seenUnscoped` is the open listing the + // index was built from, by number, so every lookup below is a `Map.get`: no + // request. An index short of some comment threads is short of EDGES, and each + // of these rows is a claim about edges in hand, so none is suspended for it. + const waitsOn = blockersByDependent(blockingIndex); for (const issue of unscoped) { - const incoherent = h14BlockingCacheIncoherent(issue, blockingIndex, { indexComplete }); - if (incoherent) findings.push([issue, 'H14', incoherent]); + const underGraded = h78BlockerBelowBlockedGrade(issue, blockingIndex, seenUnscoped); + if (underGraded) findings.push([issue, 'H78', underGraded]); + const holdMismatch = h79HoldMismatch(issue, waitsOn.get(issue.number), seenUnscoped); + if (holdMismatch) findings.push([issue, 'H79', holdMismatch]); + } + // One row per group, attached to its lowest-numbered card — so it links, + // sorts and truncates exactly like every other row. + for (const cycle of h80BlockingCycleRows(blockingIndex, seenUnscoped)) { + findings.push([cycle.issue, 'H80', cycle.message]); } - - // One row, attached to the card it names — so it links, sorts and truncates - // exactly like every other row and neither renderer needs a special case. - const oldestBlocking = h15OldestUnclaimedBlocking(unscoped); - if (oldestBlocking) findings.push([oldestBlocking.issue, 'H15', oldestBlocking.message]); // H20 — the dispatched card nobody is working. Two reads, both bounded by // the `pm:dispatched` population rather than the board: @@ -25267,6 +25592,11 @@ async function sweepInto(findings, seen, seenPrs, seenMerged, seenUnscoped, seen // which is the write to fix. Both fire on one card, deliberately. const staleBody = h28StaleBodyBlockerLine(issue, resolutions, fallbackFor(issue)); if (staleBody) findings.push([issue, 'H28', staleBody]); + // H77 — the same resolutions, asked the question H4 and H19 leave between + // them: a line exists, and does it name anything OPEN? It stands down for + // either of those rows, so a card is reported under exactly one of the three. + const noOpenTarget = h77BlockNamesNoOpenTarget(issue, resolutions, fallbackFor(issue)); + if (noOpenTarget) findings.push([issue, 'H77', noOpenTarget]); } // Distinct targets, which is the unit the cache and the request count are // in — and the word is in the summary sentence so the number cannot be read @@ -25996,7 +26326,6 @@ async function selfTest() { const h11row = (...args) => String(h11ImportantParked(...args) ?? ''); const h12row = (...args) => String(h12OrphanLanding(...args) ?? ''); const h13row = (...args) => String(h13DomainWithoutPmState(...args) ?? ''); - const h14row = (...args) => String(h14BlockingCacheIncoherent(...args) ?? ''); const h16row = (...args) => String(h16StuckMergeConflict(...args) ?? ''); const h18row = (...args) => String(h18RetriageAged(...args) ?? ''); const h19row = (...args) => String(h19BlockOutlivedBlocker(...args) ?? ''); @@ -26073,9 +26402,11 @@ async function selfTest() { // The gathering policy — what gets READ AT ALL. t('gate: a body-clean pm:blocked card is a candidate', needsBlockedByComments(issue(['pm:blocked'], [], 'no line here')), true); - t('gate: a body-clean pm:blocking card is a candidate', needsBlockedByComments(issue(['pm:blocking'], [], 'no line here')), true); + // ⛔ The retired `pm:blocking` label is no arm of the gate any more: a card + // still carrying it buys no fetch on its strength. + t('gate: a body-clean card carrying only the RETIRED pm:blocking label is NOT a candidate', needsBlockedByComments(issue(['pm:blocking'], [], 'no line here')), false); + t('gate: …while the same card ALSO carrying pm:blocked still is — the gate reads one label', needsBlockedByComments(issue(['pm:blocking', 'pm:blocked'], [], 'no line here')), true); t('gate: a pm:blocked card whose body already carries the line is NOT', needsBlockedByComments(issue(['pm:blocked'], [], 'Blocked-by: #1')), false); - t('gate: a pm:blocking card whose body already carries the line is NOT', needsBlockedByComments(issue(['pm:blocking'], [], 'Blocked-by: #1')), false); t('gate: an ordinary queued card buys no fetch', needsBlockedByComments(issue(['pm:queue'], [], 'no line here')), false); t('gate: an on-hold card buys no fetch from THIS item', needsBlockedByComments(issue(['pm:on-hold'], [], 'no line here')), false); t('gate: a missing issue does not crash', needsBlockedByComments(undefined), false); @@ -26924,7 +27255,7 @@ async function selfTest() { t('H22: a not_planned close is residue too', h22labels(closedCard(['pm:queue'], 'not_planned')), 'pm:queue'); t('H22: a missing state_reason changes nothing it selects', h22labels({ ...closedCard(['pm:queue']), state_reason: null }), 'pm:queue'); t('H22: …and can no longer print the string undefined, having no prose to print it in', h22labels({ ...closedCard(['pm:queue']), state_reason: null }).includes('undefined'), false); - t('H22: several residue labels are all returned', h22labels(closedCard(['pm:blocked', 'pm:blocking'])), 'pm:blocked,pm:blocking'); + t('H22: several residue labels are all returned', h22labels(closedCard(['pm:blocked', 'pm:on-hold'])), 'pm:blocked,pm:on-hold'); // ⛔ The strip imperative is GONE, and this is the pin that keeps a // well-meaning restoration from bringing it back: 批 #13 refused that write by // name (⛔ 不为存量补写), so the predicate must not be able to prescribe it. @@ -26956,13 +27287,15 @@ async function selfTest() { // live carriers to census when it was created, and admitting it at creation // is what keeps the state from accruing the residue this row exists to catch // before anyone thinks to measure it (#11196 fix 5). - t('H22: the residue set is the census five + the newly ruled state', PM_RESIDUE_LABELS.join(','), 'pm:dispatched,pm:queue,pm:blocked,pm:on-hold,pm:blocking,pm:awaiting-maintainer'); + t('H22: the residue set is the four census labels still in the vocabulary + the newly ruled state', PM_RESIDUE_LABELS.join(','), 'pm:dispatched,pm:queue,pm:blocked,pm:on-hold,pm:awaiting-maintainer'); // …and the two similarly-named sets stay APART: H13's carries `finding`, this - // one carries `pm:blocking`, and unifying them would break both items. + // one does not, and unifying them would break both items. t('H22: the residue set is NOT H13\'s visibility set', PM_RESIDUE_LABELS.join(',') === PM_STATE_LABELS.join(','), false); t('H22: …H13\'s set carries `finding`, which is a fine state to close in', PM_STATE_LABELS.includes('finding'), true); t('H22: …and this one does not', PM_RESIDUE_LABELS.includes('finding'), false); - t('H22: …while `pm:blocking` is residue here and absent from H13\'s', PM_RESIDUE_LABELS.includes('pm:blocking') && !PM_STATE_LABELS.includes('pm:blocking'), true); + // The census's fifth label is RETIRED: no set reads it, this one included. + t('H22: …and the RETIRED `pm:blocking` is in neither set', PM_RESIDUE_LABELS.includes('pm:blocking') || PM_STATE_LABELS.includes('pm:blocking'), false); + t('H22: …so a closed card carrying only that retired label is clean', h22ClosedCardPmResidue(closedCard(['pm:blocking'])), null); for (const label of PM_RESIDUE_LABELS) { t(`H22: \`${label}\` on a closed card is residue`, h22labels(closedCard([label])), label); } @@ -27228,11 +27561,11 @@ async function selfTest() { t('H9: the manual row carries no unparsed hedge', h9row(hold('Restart-when: manual — reason')).includes('cannot parse'), false); t('H9: …but does still demote closing', h9row(hold('Restart-when: manual — reason')).includes('Closing is the LAST resort'), true); // The channel contract, stated in the row itself — two channels since - // #10403, symmetric with H4/H14. An undocumented difference between two + // #10403, symmetric with H4. An undocumented difference between two // adjacent rules is how the last two half-states on that lane were made, // and an undocumented SAMENESS would repeat it in mirror image. t('H9: the row states the two-channel contract', h9NoLine.includes('body OR a comment'), true); - t('H9: …and names the predicates it now matches', h9NoLine.includes('H4/H14'), true); + t('H9: …and names the predicate it now matches', h9NoLine.includes('like `Blocked-by:` (H4)'), true); t('H9: …and the manual row states it too', h9row(hold('Restart-when: manual — x')).includes('body OR a comment'), true); // -- H9's COMMENT channel (#10403) ----------------------------------------- @@ -27539,9 +27872,9 @@ async function selfTest() { t('H13: pm:queue pairs the domain label -> clean', h13DomainWithoutPmState(domainCard(['domain:engine-core', 'pm:queue'], hoursAgo(26)), NOW), null); t('H13: needs-user-decision is a state (the inbox reads it) -> clean', h13DomainWithoutPmState(domainCard(['domain:spec', 'needs-user-decision'], hoursAgo(200)), NOW), null); t('H13: finding is a state (the grading round reads it) -> clean', h13DomainWithoutPmState(domainCard(['domain:cli', 'finding'], hoursAgo(200)), NOW), null); - // `pm:blocking` is a derived priority cache, not a state — a card carrying + // The retired `pm:blocking` label was never a state — a card still carrying // only it is exactly as invisible to candidate queries, so it still flags. - t('H13: pm:blocking alone is NOT a state -> still a finding', typeof h13DomainWithoutPmState(domainCard(['domain:services', 'pm:blocking'], hoursAgo(26)), NOW), 'string'); + t('H13: the retired pm:blocking label alone is NOT a state -> still a finding', typeof h13DomainWithoutPmState(domainCard(['domain:services', 'pm:blocking'], hoursAgo(26)), NOW), 'string'); t('H13: status:parked exemption (its normal shape IS this one)', h13DomainWithoutPmState(domainCard(['domain:services', 'status:parked'], hoursAgo(200)), NOW), null); t('H13: tracking exemption', h13DomainWithoutPmState(domainCard(['domain:devx', 'tracking'], hoursAgo(200)), NOW), null); t('H13: qa-run exemption', h13DomainWithoutPmState(domainCard(['domain:cli', 'qa-run'], hoursAgo(200)), NOW), null); @@ -27569,7 +27902,7 @@ async function selfTest() { t('H18: retriage past the threshold, coexisting pm:queue -> finding', typeof h18RetriageAged(domainCard(['pm:retriage', 'pm:queue'], hoursAgo(3)), NOW), 'string'); t('H18: …and the finding names the threshold', h18row(domainCard(['pm:retriage', 'pm:queue'], hoursAgo(3)), NOW).includes(`${RETRIAGE_STALE_HOURS}h`), true); t('H18: …and names the coexisting standing label', h18row(domainCard(['pm:retriage', 'pm:queue'], hoursAgo(3)), NOW).includes('`pm:queue`'), true); - t('H18: multiple coexisting labels are all named', h18row(domainCard(['pm:retriage', 'pm:blocked', 'pm:blocking'], hoursAgo(3)), NOW).includes('`pm:blocked`') && h18row(domainCard(['pm:retriage', 'pm:blocked', 'pm:blocking'], hoursAgo(3)), NOW).includes('`pm:blocking`'), true); + t('H18: multiple coexisting labels are all named', h18row(domainCard(['pm:retriage', 'pm:blocked', 'pm:on-hold'], hoursAgo(3)), NOW).includes('`pm:blocked`') && h18row(domainCard(['pm:retriage', 'pm:blocked', 'pm:on-hold'], hoursAgo(3)), NOW).includes('`pm:on-hold`'), true); // The label is a QUESTION put to the triage seat, not a request to re-grade // (SKILL.md 「`pm:retriage` 每 fire 先答异议评论所求,答后同笔摘标;须维护者答的进收件箱,标照摘」): // the row says the question is unanswered, and the remedy is to answer what @@ -27710,55 +28043,15 @@ async function selfTest() { t('index: an absent comments map leaves the body reading untouched', buildBlockingIndex([carded(10, [], 'Blocked-by: #5')], { repo: 'objectstack-ai/objectstack' }).get(5).join(','), '10'); t('index: an empty comment list for a card is harmless', idxc([carded(10, [], 'Blocked-by: #5')], [[10, []]]).get(5).join(','), '10'); - // Direction A — the label carried with nothing targeting it. - t('H14-A: pm:blocking with nothing targeting it -> finding', typeof h14BlockingCacheIncoherent(carded(7276, ['pm:queue', 'pm:blocking']), idx([])), 'string'); - t('H14-A: …and it names the stale-cache reading', h14row(carded(7276, ['pm:blocking']), idx([])).includes('stale derived cache'), true); - t('H14-A: …and prescribes the derivation pass, never a label from here', h14row(carded(7276, ['pm:blocking']), idx([])).includes('derivation pass'), true); - t('H14-A: …and says why stale is worse than absent', h14row(carded(7276, ['pm:blocking']), idx([])).includes('with authority'), true); - // The repo-boundary wording (#10139): STALE reads as "no dependent in this - // repo", never as exhaustive over the population, and the remedy is - // conditional on a cross-repo check rather than an outright drop. - t('H14-A: …names the repo boundary', h14row(carded(7276, ['pm:blocking']), idx([])).includes('no dependent found in this repo'), true); - t('H14-A: …and says cross-repo dependents are not swept', h14row(carded(7276, ['pm:blocking']), idx([])).includes('cross-repo dependents are not swept'), true); - t('H14-A: …and the remedy is conditional on verifying cross-repo dependents', h14row(carded(7276, ['pm:blocking']), idx([])).includes('verify cross-repo dependents before'), true); - // The negative: the old exhaustive phrasing ("the full two-channel index", - // instructing an unconditional drop) must be gone — it is what would have - // told a reader to sever the live #7917 / objectui#4356 edge. - t('H14-A: …and the old exhaustive phrasing is GONE', h14row(carded(7276, ['pm:blocking']), idx([])).includes('full two-channel index'), false); - // The negative for direction A: the label is EARNED, so nothing to report. - t( - 'H14-A: pm:blocking with a real dependent -> clean', - h14BlockingCacheIncoherent(carded(5, ['pm:blocking']), idx([carded(10, [], 'Blocked-by: #5')])), - null, - ); - - // Direction B — targeted, but the cache never landed. - const missingIdx = idx([carded(9650, ['pm:queue'], 'Blocked-by: #9832')]); - t('H14-B: targeted without pm:blocking -> finding', typeof h14BlockingCacheIncoherent(carded(9832, ['bug', 'pm:dispatched', 'domain:cli']), missingIdx), 'string'); - t('H14-B: …and it names the waiting card', h14row(carded(9832, ['pm:dispatched']), missingIdx).includes('#9650'), true); - t('H14-B: …and calls it an invisible unblocker', h14row(carded(9832, ['pm:dispatched']), missingIdx).includes('selection order cannot see'), true); - // The negative for direction B: no label and nobody waiting is the ordinary - // shape of ~230 of this board's ~234 open cards. It must be silent, or the - // row means nothing. - t('H14-B: no label and nothing targeting it -> clean', h14BlockingCacheIncoherent(carded(4321, ['pm:queue', 'domain:cli']), idx([])), null); - // The cross-repo consequence, end to end: #7917's objectui blocker must not - // manufacture a direction-B row against this repo's #4356. - t( - 'H14-B: a cross-repo blocker does not flag the local card of that number', - h14BlockingCacheIncoherent(carded(4356, ['pm:queue']), idx([carded(7917, [], 'Blocked-by: objectstack-ai/objectui#4356')])), - null, - ); - // Fan-out cap: named, then counted. + // Fan-out and the measured boards — pins on the INDEX itself. They used to be + // read through the `pm:blocking` cache rows (H14/H15, retired with the label); + // the edges they prove are what H78–H80 and instruction ④ read now. const manyDeps = idx(Array.from({ length: 7 }, (_, i) => carded(100 + i, [], 'Blocked-by: #5'))); - t('H14-B: a large fan-out names the cap and counts the rest', h14row(carded(5, ['pm:queue']), manyDeps).includes(`+${7 - BLOCKING_DEPENDENT_LIST_CAP} more`), true); - t('H14-B: …and reports the true total, not the capped one', h14row(carded(5, ['pm:queue']), manyDeps).includes('targeted by 7 open card(s)'), true); - t('H14: a missing index does not crash and reads as untargeted', h14BlockingCacheIncoherent(carded(5, ['pm:blocking']), undefined) !== null, true); - - // Reverse verification against the LIVE board, 2026-08-19 (234 open cards). - // Predicted before running: direction A fires on #7276 (the board's only - // `pm:blocking` card, targeted by nothing), direction B fires on the five - // targeted-but-unlabeled cards. Both held. Not one coherent pairing existed - // at that reading — the cache had drifted to 0% agreement with its index. + t('index: a large fan-out lists every dependent, in listing order', manyDeps.get(5).join(','), '100,101,102,103,104,105,106'); + t('index: a missing listing reads as an empty index for any reader', buildBlockingIndex(undefined).get(5), undefined); + + // The LIVE board, 2026-08-19 (234 open cards): eight body lines, one of them + // cross-repo and one naming two targets. const liveBodies = [ carded(9849, ['pm:queue'], 'Blocked-by: #9823'), carded(9784, ['pm:queue'], 'Blocked-by: #9689 (the relocation it needs is the same edit).'), @@ -27770,30 +28063,25 @@ async function selfTest() { carded(2657, ['pm:blocked'], 'Blocked-by: #6234\nBlocked-by: #6245'), ]; const liveIdx = idx(liveBodies); - t('H14 reverse-verify: #7276 (the board\'s only pm:blocking card) -> stale finding', typeof h14BlockingCacheIncoherent(carded(7276, ['pm:queue', 'domain:devx', 'pm:blocking']), liveIdx), 'string'); - t('H14 reverse-verify: #9832 (targeted by #9650, unlabeled) -> missing finding naming #9650', h14row(carded(9832, ['bug', 'pm:dispatched', 'domain:cli']), liveIdx).includes('#9650'), true); - t('H14 reverse-verify: #9919 (targeted by #9249, unlabeled) -> missing finding', typeof h14BlockingCacheIncoherent(carded(9919, ['pm:queue', 'repo:cloud']), liveIdx), 'string'); - // …and the four measured NON-findings from the same reading, which is what - // makes the six above readable as signal rather than as a predicate that - // flags everything: a dependent card, a closed target's dependent, the - // cross-repo number, and an ordinary untouched card. - t('H14 reverse-verify: #9650 (a waiting card, not an unblocker) -> clean', h14BlockingCacheIncoherent(carded(9650, ['pm:queue']), liveIdx), null); - t('H14 reverse-verify: local #4356 (the objectui blocker\'s number) -> clean', h14BlockingCacheIncoherent(carded(4356, ['pm:queue']), liveIdx), null); - t('H14 reverse-verify: #2657 (blocked on two CLOSED cards) -> clean', h14BlockingCacheIncoherent(carded(2657, ['pm:blocked']), liveIdx), null); - t('H14 reverse-verify: an ordinary open card -> clean', h14BlockingCacheIncoherent(carded(9913, ['pm:queue', 'repo:cloud']), liveIdx), null); - - // -- H14 + the comment channel: the two MEASURED false stales (#10061) ----- + t('index reverse-verify: #9832 is targeted by #9650', liveIdx.get(9832).join(','), '9650'); + t('index reverse-verify: #9919 is targeted by #9249', liveIdx.get(9919).join(','), '9249'); + t('index reverse-verify: a waiting card is not itself a target', liveIdx.has(9650), false); + t('index reverse-verify: the cross-repo blocker creates no local #4356 entry', liveIdx.has(4356), false); + t('index reverse-verify: a two-line card targets both', `${liveIdx.get(6234).join(',')}|${liveIdx.get(6245).join(',')}`, '2657|2657'); + t('index reverse-verify: eight local targets in all, the cross-repo line excluded', liveIdx.size, 8); + + // -- The comment channel: the two MEASURED missing edges (#10061) ----------- // - // Both were reported stale on 2026-08-19 by a body-only index while their - // dependents stated the wait in comments. The comment bodies below are the - // real ones from those threads, trimmed to the load-bearing lines. These are - // regression pins: a body-only index makes each of the two "-> stale" rows - // pass and each of the two "-> clean" rows fail. + // Both targets read as waited-on-by-nobody on 2026-08-19 against a body-only + // index, while their dependents stated the wait in comments. The comment + // bodies below are the real ones from those threads, trimmed to the + // load-bearing lines. These are regression pins: a body-only index makes + // each of the two union rows fail. const falseStaleSources = [ - // #9465 (epic, `pm:blocking`): both dependents are body-clean. + // #9465 (an epic): both dependents are body-clean. carded(9709, ['pm:blocked'], 'Card body: add the console-injection guard to release.yml.'), carded(9828, ['pm:blocked'], 'Card body: cut-rc.yml points a curator at an expired deadline.'), - // #9968 (decision card, `pm:blocking`): same shape. + // #9968 (a decision card): same shape. carded(9969, ['pm:blocked'], 'Card body: consumerless vendor `/admin/` surface posture.'), carded(9652, ['pm:blocked'], 'Card body: set-role veto tension in the same vendor-admin family.'), ]; @@ -27808,174 +28096,24 @@ async function selfTest() { repo: 'objectstack-ai/objectstack', comments: falseStaleComments, }); - const epic9465 = carded(9465, ['domain:devx', 'pm:epic', 'pm:blocking']); - const decision9968 = carded(9968, ['pm:decision', 'pm:blocking']); - // The defect, pinned: this is what the body-only index reported. - t('H14 false-stale: #9465 reads STALE against a body-only index', h14row(epic9465, bodyOnlyIdx).includes('stale derived cache'), true); - t('H14 false-stale: #9968 reads STALE against a body-only index', h14row(decision9968, bodyOnlyIdx).includes('stale derived cache'), true); - // The fix: the same two cards against the two-channel index. - t('H14 false-stale: #9465 is CLEAN once comment edges are read', h14BlockingCacheIncoherent(epic9465, unionIdx), null); - t('H14 false-stale: #9968 is CLEAN once comment edges are read', h14BlockingCacheIncoherent(decision9968, unionIdx), null); - t('H14 false-stale: …because #9709 and #9828 both point at #9465', unionIdx.get(9465).join(','), '9709,9828'); - t('H14 false-stale: …and #9969 and #9652 both point at #9968', unionIdx.get(9968).join(','), '9969,9652'); - // Direction B rides the same union: a comment-only edge is enough to call a - // card an invisible unblocker. - t('H14-B: a comment-only edge produces a missing-cache row', h14row(carded(9465, ['domain:devx']), unionIdx).includes('#9709'), true); - t('H14-B: …and the sentence names the channel pair', h14row(carded(9465, ['domain:devx']), unionIdx).includes('body or comment'), true); - t('H14-A: …the stale sentence names both channels too', h14row(epic9465, bodyOnlyIdx).includes('body OR comment'), true); - - // -- H14 under an INCOMPLETE index (a gated comment fetch failed) ---------- - // - // Asymmetric on purpose: stale is a claim about ABSENT evidence and must not - // be made from an index known to be missing edges (#4690); missing is a - // claim about evidence in hand, which reading more sources can only add to. - t('H14-A: stale is SUSPENDED when the index is known incomplete', h14BlockingCacheIncoherent(epic9465, bodyOnlyIdx, { indexComplete: false }), null); - t('H14-A: …and still fires when the index is complete', typeof h14BlockingCacheIncoherent(epic9465, bodyOnlyIdx, { indexComplete: true }), 'string'); - t('H14-A: …and completeness defaults to true for body-only callers', typeof h14BlockingCacheIncoherent(epic9465, bodyOnlyIdx), 'string'); - t('H14-B: missing SURVIVES an incomplete index', h14row(carded(9465, ['domain:devx']), unionIdx, { indexComplete: false }).includes('#9709'), true); - t('H14-B: …and an earned label stays clean either way', h14BlockingCacheIncoherent(epic9465, unionIdx, { indexComplete: false }), null); - - // -- H14: the SEAM DECLINE on the stale direction (#13975) ----------------- - // - // ⚠️ NAMING, because the two vocabularies are inverted and a case written - // under the wrong one pins the wrong direction: the cases above call STALE - // "H14-A" and MISSING "H14-B", while the filing card #13975 calls the strip - // "direction B". The ruling is about the STRIP under either name, so these - // cases say `seam` and name the direction in words. - // - // The fixtures are the real cards the defect was measured on (2026-08-31, 5 - // stale rows): #12931 carries `repo:cloud` and declines; #13439 sits in the - // SAME position carrying no `repo:*` label and still fires — which is the - // predicate's measured under-coverage, since that card's own filing records - // cloud#1451 waiting on it. - const seamIdx = idx([]); - const seamCard = carded(12931, ['pm:queue', 'repo:cloud', 'pm:blocking']); - const nonSeamCard = carded(13439, ['bug', 'priority:p1', 'pm:queue', 'domain:spec', 'pm:blocking']); - const swept = { ownerRepo: 'objectstack-ai/objectstack' }; - - // The predicate, alone: one reading of the `repo:*` family, `censusLanesOf`'s. - t('H14 seam: the predicate reads the repo:* family', seamRepoLabels(seamCard).join(','), 'repo:cloud'); - t('H14 seam: …and is empty on a card carrying none', seamRepoLabels(nonSeamCard).length, 0); - t('H14 seam: …and a domain lane is not a repo lane', seamRepoLabels(carded(1, ['domain:spec', 'pm:blocking'])).length, 0); - t('H14 seam: …and more than one repo label is all of them', seamRepoLabels(carded(1, ['repo:cloud', 'domain:spec', 'repo:hotcrm'])).join(','), 'repo:cloud,repo:hotcrm'); - t('H14 seam: …and a missing issue does not crash', seamRepoLabels(undefined).length, 0); - - // The decline: EMITTED, never suppressed (the row is the seam card's only - // trace in the report — H32's silent `foreign` return is the other shape, - // and it belongs to a row whose POPULATION is out of scope, not one whose - // evidence is unreadable). - t('H14 seam: a seam card in the stale position still EMITS a row', typeof h14BlockingCacheIncoherent(seamCard, seamIdx, swept), 'string'); - t('H14 seam: …and the row declines rather than accusing', h14row(seamCard, seamIdx, swept).includes('DECLINES to judge'), true); - t('H14 seam: …and names the label it declined on', h14row(seamCard, seamIdx, swept).includes('`repo:cloud`'), true); - t('H14 seam: …and says the evidence is UNREADABLE, not absent', h14row(seamCard, seamIdx, swept).includes('UNREADABLE'), true); - t('H14 seam: …and that no re-run resolves it', h14row(seamCard, seamIdx, swept).includes('no re-run resolves it'), true); - t('H14 seam: …and reads as UNJUDGED, never as a stale cache', h14row(seamCard, seamIdx, swept).includes('stale derived cache'), false); - t('H14 seam: …so it never prescribes the strip', h14row(seamCard, seamIdx, swept).includes('drops the label'), false); - t('H14 seam: …and forbids the hand-strip as well as the hand-apply', h14row(seamCard, seamIdx, swept).includes('hand-stripped'), true); - // The trim-order rank, which is what makes "emitted" mean "still there in the - // rendered body" (#11218). Without it a decline is a suppression on a delay. - t('H14 seam: …and the row carries the UNJUDGED rank', isUnjudgedFinding(h14row(seamCard, seamIdx, swept)), true); - t('H14 seam: …while the ordinary stale row does NOT (it made a determination)', isUnjudgedFinding(h14row(nonSeamCard, seamIdx, swept)), false); - // Report-only and never loud, the H14–H16 property the decline must not break. - t('H14 seam: …and the decline is not a loud finding', isLoudFinding(h14row(seamCard, seamIdx, swept)), false); - // The card's own re-check (`grep -E "H14 .*carried while no open"`) has to - // keep listing BOTH shapes, or the seam cards vanish from the one-liner the - // filing seat used to find them. - t('H14 seam: …and the row head still answers the card\'s re-check grep', /carried while no open/u.test(h14row(seamCard, seamIdx, swept)), true); - - // The paired negative: the same position, no `repo:*` label -> still fires. - t('H14 seam: a NON-seam card in the same position still fires', h14row(nonSeamCard, seamIdx, swept).includes('stale derived cache'), true); - t('H14 seam: …and its row names its own scope', h14row(nonSeamCard, seamIdx, swept).includes('no dependent found in this repo'), true); - t('H14 seam: …and says the missing label is NOT evidence of an in-repo audience', h14row(nonSeamCard, seamIdx, swept).includes('58 of the 67'), true); - - // An earned label is clean whether or not the card is a seam: the decline - // fires on the stale position only, never on the population. - t('H14 seam: a seam card with a real in-repo dependent -> clean', h14BlockingCacheIncoherent(seamCard, idx([carded(10, [], 'Blocked-by: #12931')]), swept), null); - // Suspension outranks the decline: an index known incomplete silences the - // whole direction, unchanged by this row. - t('H14 seam: an incomplete index still silences the direction outright', h14BlockingCacheIncoherent(seamCard, seamIdx, { ...swept, indexComplete: false }), null); - - // ⛔ The ADD direction is untouched on a seam card, and byte-identically so: - // a cross-repo edge the index cannot see can only make THAT direction - // under-label, which is the status quo and starves nobody. - const addIdx = idx([carded(9249, ['pm:queue'], 'Blocked-by: #9919')]); - t('H14 seam: the ADD direction still fires on a seam card', h14row(carded(9919, ['pm:queue', 'repo:cloud']), addIdx, swept).includes('#9249'), true); - t( - 'H14 seam: …and its sentence is byte-identical to the same card without the label', - h14row(carded(9919, ['pm:queue', 'repo:cloud']), addIdx, swept), - h14row(carded(9919, ['pm:queue']), addIdx, swept), - ); - - // The over-covered edge, pinned rather than narrowed. `repo:objectstack` is - // not in the label ledger's seam family but 4 open cards carried it on - // 2026-08-31, and the ruled predicate is "any `repo:*` label" — so it - // declines, and SAYS the decline is conservative rather than asserting an - // off-repo audience it cannot see. - const ownRepoCard = carded(1, ['pm:queue', 'repo:objectstack', 'pm:blocking']); - t('H14 seam: a label naming the swept repo declines too (the predicate is literal)', h14row(ownRepoCard, seamIdx, swept).includes('DECLINES to judge'), true); - t('H14 seam: …and says that decline is CONSERVATIVE', h14row(ownRepoCard, seamIdx, swept).includes('CONSERVATIVE'), true); - t('H14 seam: …while a sibling label claims nothing conservative', h14row(seamCard, seamIdx, swept).includes('CONSERVATIVE'), false); - // …and the reading follows the SWEPT repo rather than a hardcoded name, so a - // copy of this patrol installed in a sibling repo reads its own board. - t('H14 seam: …the conservative reading follows the swept repo', h14row(seamCard, seamIdx, { ownerRepo: 'objectstack-ai/cloud' }).includes('CONSERVATIVE'), true); - t('H14 seam: …and a seam label there is still structural', h14row(ownRepoCard, seamIdx, { ownerRepo: 'objectstack-ai/cloud' }).includes('CONSERVATIVE'), false); + // The defect, pinned: this is what the body-only index held. + t('index union: a body-only index sees NEITHER measured target', `${bodyOnlyIdx.has(9465)}/${bodyOnlyIdx.has(9968)}`, 'false/false'); + // The fix: the same sources against the two-channel index. + t('index union: #9709 and #9828 both point at #9465 once comment edges are read', unionIdx.get(9465).join(','), '9709,9828'); + t('index union: …and #9969 and #9652 both point at #9968', unionIdx.get(9968).join(','), '9969,9652'); // The summary line carries the third `read X of Y` pair, and says out loud - // when the shortfall cost H14 its stale direction. + // what a shortfall costs: edges, never a suspended row. const fbCounts = (fallbackProbed, fallbackCandidates) => ({ repo: 'objectstack-ai/objectstack', issues: 1, unscoped: 1, prs: 0, merged: 0, fallbackProbed, fallbackCandidates, }); - t('summary: the fallback pair is reported', saidBy('h14Fallback', summaryLine(fbCounts(24, 26), 3)).includes('comment fallback read on 24 of 26 candidate(s)'), true); - t('summary: a shortfall announces the suspended stale direction', saidBy('h14Fallback', summaryLine(fbCounts(24, 26), 3)).includes('stale direction is SUSPENDED'), true); - t('summary: a complete pass says nothing about suspension', saidBy('h14Fallback', summaryLine(fbCounts(26, 26), 3)).includes('SUSPENDED'), false); - t('summary: absent fallback counts still render a sentence', saidBy('h14Fallback', summaryLine({ repo: 'r', issues: 1, unscoped: 1, prs: 0, merged: 0 }, 0)).includes('comment fallback read on 0 of 0'), true); - - // -- H15: oldest unclaimed `pm:blocking` (selection-order visibility) ------- - const blockingCard = (number, { assignees = [], created = daysAgo(3) } = {}) => ({ - ...issue(['pm:blocking', 'pm:queue'], assignees), - number, - created_at: created, - }); - - t('H15: the oldest unclaimed card is the one reported', h15OldestUnclaimedBlocking([blockingCard(10, { created: daysAgo(2) }), blockingCard(20, { created: daysAgo(9) }), blockingCard(30, { created: daysAgo(5) })], NOW).issue.number, 20); - t('H15: …and the row states the age in hours', h15OldestUnclaimedBlocking([blockingCard(20, { created: hoursAgo(220) })], NOW).message.includes('open ~220h'), true); - t('H15: …and names the selection-order rank it exists to police', h15OldestUnclaimedBlocking([blockingCard(20)], NOW).message.includes('second only to'), true); - t('H15: …and declares the age is the CARD\'s, not the label\'s', h15OldestUnclaimedBlocking([blockingCard(20)], NOW).message.includes("Age is the CARD's"), true); - t('H15: …and declares itself thresholdless visibility, not an alarm', h15OldestUnclaimedBlocking([blockingCard(20)], NOW).message.includes('no threshold'), true); - t('H15: the count separates unclaimed from the total', h15OldestUnclaimedBlocking([blockingCard(10), blockingCard(20, { assignees: ['os-help'] }), blockingCard(30, { assignees: ['os-help'] })], NOW).message.includes('1 of 3 open'), true); - // The two "no row" shapes the card names. - t('H15: every pm:blocking card assigned -> no row', h15OldestUnclaimedBlocking([blockingCard(10, { assignees: ['os-help'] }), blockingCard(20, { assignees: ['os-warren'] })], NOW), null); - t('H15: no pm:blocking card at all -> no row', h15OldestUnclaimedBlocking([{ ...issue(['pm:queue']), number: 10, created_at: daysAgo(30) }], NOW), null); - t('H15: an empty listing -> no row', h15OldestUnclaimedBlocking([], NOW), null); - t('H15: a missing listing -> no row', h15OldestUnclaimedBlocking(undefined, NOW), null); - // #4690 direction, restated for an ORDERING rather than a threshold: a - // timestamp that cannot be read must not quietly drop out of a claim about - // which card is oldest. - t('H15: unreadable created_at sorts as maximally old', h15OldestUnclaimedBlocking([blockingCard(10, { created: daysAgo(9) }), blockingCard(20, { created: 'not-a-date' })], NOW).issue.number, 20); - t('H15: …and the row says so rather than printing a number', h15OldestUnclaimedBlocking([blockingCard(20, { created: 'not-a-date' })], NOW).message.includes('unreadable `created_at`'), true); - // Built without the fixture helper on purpose: its `created = daysAgo(3)` - // default fills an `undefined`, so passing one through it tests the default - // rather than the absent field (measured — this case was green against a - // 3-day-old card before the fixture was written out longhand). - t('H15: absent created_at is unreadable too', h15OldestUnclaimedBlocking([{ ...issue(['pm:blocking']), number: 20 }], NOW).message.includes('unreadable `created_at`'), true); - // Stable output run to run: equal ages break by issue number, so the anchor - // body does not churn between two equally-old cards. - t('H15: equal ages break by issue number', h15OldestUnclaimedBlocking([blockingCard(30, { created: daysAgo(4) }), blockingCard(12, { created: daysAgo(4) })], NOW).issue.number, 12); - - // Reverse verification against the LIVE board, 2026-08-19. Predicted before - // running: NULL — the board's only `pm:blocking` card (#7276) is assigned to - // `os-project-manager`, which is the card's own "all-assigned -> no row" - // shape, measured rather than invented. Then the same card with the assignee - // removed, to prove the null is the board's state and not a dead predicate. - const live7276 = (assignees) => ({ - ...issue(['pm:queue', 'domain:devx', 'pm:blocking'], assignees), - number: 7276, - created_at: '2026-08-10T04:30:43Z', - }); - t('H15 reverse-verify: the live board (only blocking card assigned) -> no row', h15OldestUnclaimedBlocking([live7276(['os-project-manager'])], Date.parse('2026-08-19T09:00:00Z')), null); - t('H15 reverse-verify: …the same card unassigned DOES produce the row', h15OldestUnclaimedBlocking([live7276([])], Date.parse('2026-08-19T09:00:00Z')).issue.number, 7276); - t('H15 reverse-verify: …and its measured age', h15OldestUnclaimedBlocking([live7276([])], Date.parse('2026-08-19T09:00:00Z')).message.includes('open ~220h'), true); + t('summary: the fallback pair is reported', saidBy('blockedByFallback', summaryLine(fbCounts(24, 26), 3)).includes('comment fallback read on 24 of 26 candidate(s)'), true); + t('summary: a shortfall says the index is MISSING edges', saidBy('blockedByFallback', summaryLine(fbCounts(24, 26), 3)).includes('the reverse index is MISSING the edges those threads carry'), true); + t('summary: a complete pass says nothing about missing edges', saidBy('blockedByFallback', summaryLine(fbCounts(26, 26), 3)).includes('MISSING'), false); + t('summary: absent fallback counts still render a sentence', saidBy('blockedByFallback', summaryLine({ repo: 'r', issues: 1, unscoped: 1, prs: 0, merged: 0 }, 0)).includes('comment fallback read on 0 of 0'), true); + // ⛔ No clause anywhere still speaks for the retired cache rows. + t('summary: no clause names the retired H14 or a suspended direction', /H14|SUSPENDED/u.test(summaryLine(fbCounts(24, 26), 3)), false); // -- H19: a block that outlived its blocker (2026-08-20) ------------------- // The two measured instances are the fixtures, and they are DIFFERENT @@ -28020,7 +28158,7 @@ async function selfTest() { // The gathering gate. t('H19 gate: an open pm:blocked card is in scope', needsBlockerLiveness(blockedCard(1, 'Blocked-by: #2')), true); t('H19 gate: a Blocked-by line WITHOUT the label is out of scope', needsBlockerLiveness(blockedCard(1, 'Blocked-by: #2', ['pm:queue'])), false); - t('H19 gate: a pm:blocking card is out of scope (that is H14\'s population)', needsBlockerLiveness(blockedCard(1, '', ['pm:blocking'])), false); + t('H19 gate: a card carrying only the retired pm:blocking label is out of scope', needsBlockerLiveness(blockedCard(1, '', ['pm:blocking'])), false); t('H19 gate: a missing issue does not crash', needsBlockerLiveness(undefined), false); // The predicate. Resolutions are what the sweep resolved, so the offline @@ -28053,7 +28191,8 @@ async function selfTest() { t('H19: …and names the target', expired10112Row.includes('`#10126`'), true); t('H19: …with the close timestamp, so the latency is readable off the row', expired10112Row.includes('closed 2026-08-20T09:03:37Z'), true); t('H19: …and says the block outlived its blocker', expired10112Row.includes('outlived its blocker'), true); - t('H19: …and says nothing else here asks this question', expired10112Row.includes('H4 asks whether the line EXISTS'), true); + t('H19: …and says nothing else here asks this question', expired10112Row.includes('H4 asks only whether the line EXISTS'), true); + t('H19: ⛔ …and no longer cites the retired cache row as a second reader', expired10112Row.includes('H14'), false); t('H19: …and hands the release to the unlock sweep\'s double-checks', expired10112Row.includes('放行双查'), true); t('H19: …naming double-check ① (most recent conversion comment)', expired10112Row.includes('MOST RECENT conversion comment'), true); t('H19: …and double-check ② (a newer merged PR refuses release)', expired10112Row.includes('MERGED PR newer than that conversion comment'), true); @@ -28158,7 +28297,7 @@ async function selfTest() { t('H19: the target list is capped at the render budget', manyClosed.includes(`+${7 - H19_TARGET_LIST_CAP} more`), true); t('H19: …and the count is the full one, not the shown one', manyClosed.includes('7 of 7'), true); - // Report-only, ordinary row in both media — never loud, like H14–H16/H18. + // Report-only, ordinary row in both media — never loud, like H16/H18. t('H19: not a loud finding', isLoudFinding(expired10112), false); // -- H19: the two MEASURED instances, byte-for-byte ------------------------ @@ -28286,7 +28425,7 @@ async function selfTest() { // ⛔ The precedence rule must not reach the DISCOVERY union that H26 and H28 // read: both still see the comment-borne target on the live #11333 shape. t('H19 precedence: ⛔ H28 is unaffected on the live shape (no spent body line)', h28StaleBodyBlockerLine(live11333, live11333Targets, [LIVE_11333_COMMENT], REPO_OS), null); - t('H19 precedence: ⛔ and H26 still reads the full union', typeof h26BlockOnIndefiniteTarget(live11333, [target(13457, 'open', { labels: ['pm:blocking'] }), target(13458, 'open', { labels: ['pm:blocked'] })]), 'string'); + t('H19 precedence: ⛔ and H26 still reads the full union', typeof h26BlockOnIndefiniteTarget(live11333, [target(13457, 'open', { labels: ['pm:queue'] }), target(13458, 'open', { labels: ['pm:blocked'] })]), 'string'); // -- BATTERY: H19 founds every verdict on the set it JUDGES (#18379) ------- // @@ -29092,7 +29231,7 @@ async function selfTest() { t('H63 control: …and the same card with one grading state fires', typeof h63StaleFindingBesideGrade(gradedCarrier(['finding', 'pm:blocked'])), 'string'); t('⛔ H63: `finding` beside a `domain:*` alone is still ungraded — routing is not a grade', h63StaleFindingBesideGrade(gradedCarrier(['finding', 'domain:skills'])), null); t('H63 control: …and adding a priority to that card fires it', typeof h63StaleFindingBesideGrade(gradedCarrier(['finding', 'domain:skills', 'priority:p2'])), 'string'); - t('⛔ H63: `pm:blocking` is not a grade either — it is a derived cache', h63StaleFindingBesideGrade(gradedCarrier(['finding', 'pm:blocking'])), null); + t('⛔ H63: the retired `pm:blocking` label is not a grade either', h63StaleFindingBesideGrade(gradedCarrier(['finding', 'pm:blocking'])), null); t('⛔ H63: nor is `pm:retriage`, an annotation ON a state', h63StaleFindingBesideGrade(gradedCarrier(['finding', 'pm:retriage'])), null); t('⛔ H63: a `pm:seat` post is NEVER judged, whatever else it carries', h63StaleFindingBesideGrade(gradedCarrier(['finding', 'pm:seat', 'priority:p1'])), null); t('H63 control: …and the identical card without `pm:seat` fires, so it is the seat post that silenced it', typeof h63StaleFindingBesideGrade(gradedCarrier(['finding', 'priority:p1'])), 'string'); @@ -29951,7 +30090,7 @@ async function selfTest() { // -- H16 incident fixture: PR #9826, the measured specimen ----------------- // The devx incident this item exists for: a conflict that hung ~4h while - // auto-merge was armed, and not one of H1–H15 could express the state. + // auto-merge was armed, and not one of the earlier rows could express the state. // // ⚠️ The `dirty` reading is the INCIDENT's, recorded on the card — not a // live reading. Measured again here on 2026-08-19 while implementing H16, @@ -30238,7 +30377,7 @@ async function selfTest() { t('markdown: …and is NOT sorted above the loud band', renderMarkdown([h19Row, loudRow], counts).indexOf('#900') < renderMarkdown([h19Row, loudRow], counts).indexOf('#10112'), true); t('plain: …and the markdown renderer on the same input DOES sort loud first', renderMarkdown([quietRow, loudRow], counts).indexOf('#900') < renderMarkdown([quietRow, loudRow], counts).indexOf('#200'), true); t('summaryLine: names what was READ, not only what was found', saidBy('head', summaryLine(counts, 0)).includes('swept 3 open pm-/p0-labeled issue(s)'), true); - t('summaryLine: the unscoped-pass clause names H18 alongside H13-H15', saidBy('head', summaryLine(counts, 0)).includes('unscoped pass (H13–H15, H18)'), true); + t('summaryLine: the unscoped-pass clause names every row that reads it', saidBy('head', summaryLine(counts, 0)).includes('unscoped pass (H13, H18, H78–H81)'), true); // H16's pair is the row-granular half of the same #4690 property: a detail // pass that read NOTHING must not be indistinguishable from a board with no // conflicts, so the sentence carries `read X of Y` rather than only findings. @@ -30422,20 +30561,22 @@ async function selfTest() { t('markdown: the literal marker leads the body (no angle brackets to sanitize)', mixed.startsWith('os-half-state-sweep'), true); t('markdown: the body carries no HTML-comment marker the sanitizer could eat', mixed.includes('