diff --git a/.claude/skills/pm-dispatch/SKILL.md b/.claude/skills/pm-dispatch/SKILL.md index 18567e2a07f..00cd784b397 100644 --- a/.claude/skills/pm-dispatch/SKILL.md +++ b/.claude/skills/pm-dispatch/SKILL.md @@ -148,8 +148,8 @@ PM 的工作是循环:选卡 → 认领 → 派发 → 收集 → L1 审核 → - 未发版 ⇒ 转 `pm:on-hold`;`Restart-when:` 写安装面判据与唤醒后派发形状,⛔ 不回 `pm:queue`。 - 状态变更不过夜:标签无评论、assignee 无认领评论、结论只在 chat,都是半状态。 - 半状态在结束会话(含限流悬挂)前补齐成对或回滚半边;report-only 巡查见守卫索引。 -- 等待他座位也是状态,写在卡上才存在(等谁、自何时),⛔ 不留在会话记忆。 -- P0 嫌疑的等待走紧急直接分诊通道,是义务非选项。 +- 等待他座位也是状态,写在卡上才存在(等谁、自何时),⛔ 不留会话记忆。 +- P0 嫌疑等待走紧急直接分诊通道,是义务非选项。 - 代执行他人指令的关闭、摘标、回收认领,评论带出处三件:谁的指令、原话、在哪说。 - 标签写恒四步:取现集 → 只增删目标 → 写合并集 → 回读 diff 对 union(现集, 增删)。 - union 有而回读缺 = 被并发剥掉,重挂并报告。 @@ -163,7 +163,7 @@ PM 的工作是循环:选卡 → 认领 → 派发 → 收集 → L1 审核 → - 锚定规则:每个包恰属一个域;`domain:*` = 修复落地包的域;`Seam:` 卡默认纵向派发。 - `domain:*` 只决定文件归属:锚定、单认领路径;⛔ 不是队列或优先级单位。域席 server、spec、ui、devx、skills 已退役;脚本仍读或印它处行为未改,读作文件归属或既往席名。 - `Seam:` 卡认领申报两端;验收 = 消费端读该键(活性账本行离开 `planned`)或键随账本行退役。 -- 域由分诊读代码判定,⛔ 绝不从 issue 标题的词汇猜域;说不出修复碰哪个文件就还不可标。 +- 域由分诊读代码判定,⛔ 不从 issue 标题词汇猜域;说不出修复碰哪个文件即不可标。 | 标签 | 包家族 | |:--|:--| @@ -181,7 +181,7 @@ PM 的工作是循环:选卡 → 认领 → 派发 → 收集 → L1 审核 → - 退役 `domain:*` 只退流通,对象保留;`domain:engine`/`domain:services`/`domain:cli` 读作 `domain:server`。 - `domain:*` 与队列只由分诊落笔;两例外:sub-issue 承父卡域、main-red 锚卡,免审计评论。 - 无分诊审计评论 ⛔ 不得认领;车道席自分诊是上行第三例外,住 `triage-duties.md`。 -- 派发前在飞检查 `node scripts/pm/check-handover.mjs --inflight`:读 `pm:dispatched` 卡认领申报的文件面,本地求交、不另发查询。 +- 派发前在飞检查 `node scripts/pm/check-handover.mjs --inflight --paths=PATH[,PATH…]`:待派面对 `pm:dispatched` 卡认领申报面本地求交、不另发查询。 - 越界只四通道:跟到底的越界面、无主阻塞项、main-red 锚卡、spec.md 搭车。 - 合并队列是共享串行资源:车道买到并行编写,非并行落地。 - 谁发现 flake 谁修或立单,⛔ 不绕行。 @@ -198,7 +198,7 @@ PM 的工作是循环:选卡 → 认领 → 派发 → 收集 → L1 审核 → - ② PR 悬着等人批,同笔挂 `pm:awaiting-merge`;人工直合即审核记录,授权批准 ⇒ 席位落地。 - 指针 `ACCEPT → PR #n comment `;受管/spec 面欠 ①–④,席只达档补审现 head 记录未盖处。 - 核对六项:形态/前提实测/门禁 check-runs/接受的偏差/范围外去向+`Skills-docs:`/落地条款。 -- 终稿 = 席位照自己读的 diff 校正 dev 草稿、加席位意见行,置顶席位记录;维护者只读评论。 +- 终稿 = 席位照自读 diff 校正 dev 草稿、加席位意见行,置顶席位记录;维护者只读评论。 - `pm:awaiting-merge` 只挂 PR、不入六态,与请审同为等人批清单,随获批或撤回判决离开。 - 批准后再推亦不过期;席位落地 = 过落地前检、清标、ready、auto-merge,踢出/变基同法。 - ③ 请审 = 交棒:ACCEPT 与现 head 同形 PASS 俱在案,同轮一笔 `label-write.mjs --handoff` 交②③。 @@ -212,7 +212,7 @@ PM 的工作是循环:选卡 → 认领 → 派发 → 收集 → L1 审核 → - 入队资格:每 check 绿或预期 skip,⛔ 非必查子集;名单 check-expected-skips.mjs 只判 objectstack。 - 非必查红是真缺陷或坏门,归 PM 入队前处置;第三种按设计而红,三条全立才可带红入队: - 源码自述 pushed 分支上按设计而红、不跑 `merge_group`、PR 评论记明门与因,缺一即否。 -- 本段只适用本循环派发的 dev PR;PM 自己的工具 PR 留维护者。 +- 本段只适用本循环派发的 dev PR;PM 自有工具 PR 留维护者。 ## 升级与决策 diff --git a/.claude/skills/pm-dispatch/references/contract-review.md b/.claude/skills/pm-dispatch/references/contract-review.md index e671b59e18c..57d8c3717b4 100644 --- a/.claude/skills/pm-dispatch/references/contract-review.md +++ b/.claude/skills/pm-dispatch/references/contract-review.md @@ -13,16 +13,16 @@ 后者审其合契约,diff 外被引代码只读;`Scope:` 行分列两者,可放宽、⛔ 不窄于 `hits`。 - 余部归车道席位 `TIER_DEFAULT` 的 ACCEPT,同单独开 PR 并点名;Tier H 人批与队列守卫仍整张 PR。 - 面读 PR 已提交树的文件清单(同队列守卫判 governed 路径)与申报行;⛔ 不读席位自述。 -- 已发布面以包的 `exports` 映射为准:从入口类型图不可达、且 `exports` 不可寻址的 `.d.ts` 是 +- 已发布面以包的 `exports` 映射为准:从入口类型图不可达且 `exports` 不可寻址的 `.d.ts` 是 出货字节,⛔ 不是已发布接受集,改它不触发 `Clause-②: yes`;legacy node10 深引用在契约之外。 -- 四面皆不碰 ⇒ CI 加席位自读 ⛔ 不起第二个 agent;谁跑 = 派发席,档经子代理或卡线程取。 +- 四面皆不碰 ⇒ CI 加席位自读 ⛔ 不另起 agent;谁跑 = 派发席,档经子代理或卡线程取。 - p1 卡线程卡交回且欠 L2 ⇒ L1 线程起隔离 L2 子代理,与其 L1 并行,两份意见同回席。 - 送审路由只住此处:车道能取 `CONTRACT_REVIEW_TIER` 才自审;取不到(账号够不到、配额拒 429、 维护者限配)⇒ ⛔ 不降档 ⛔ 非分诊,落交接行并同笔请 L2 席(照 `lanes/l2-review.md`); 无 L2 席在座改点能取该档的兄弟席,皆无则挂等 L2 标记留欠审表待 (a)(b)(c)。交接行: - `Contract-review-handoff: — CONTRACT_REVIEW_TIER unavailable (, ) · head ` - 欠审 PR(含 draft)现 head 无记录无活认领且 (a)(b)(c) 之一 ⇒ 车道达档自审或交接,⛔ 非分诊 -- (a) 交接行/敲门点名现 head(同轮所点席接)或带等 L2 标记;(b) 现 head 已等满一轮; +- (a) 交接行/敲门点名现 head(同轮所点席接)或带等 L2 标记;(b) 现 head 已等满一轮(`seat-lifecycle.md`); - (c) 车道收班或离总表,欠审入交班简报;L2 席只接 (a) 所点、自记录 delta、他席皆禁之 head。 - L2 席或车道起审前读 PR:现 head 有记录或活认领 ⇒ ⛔ 不起;否则先落认领行,一 head 一行: - `Contract-review-claim: · head · ` @@ -32,7 +32,7 @@ - 逾 24 小时条件未满的 hold 列入分诊轮次记录(`check-owed-reviews.mjs` 标出)。 - L2 记录 = 一条评论落 PR 或卡,席内与各子代理同形;散文、dev 自评、`os-dev-report` 不算。 - 同形 = `## Contract review` 题头之下 `Head-sha:` 行独占码段、①②③逐项、独立性对、PASS/FAIL。 -- 同形含首行 `Served-tier:`:值为该面所定档常量名 `CONTRACT_REVIEW_TIER` 或 `TIER_DEFAULT`;无此行不 +- 同形含首行 `Served-tier:`:值为该面档常量名 `CONTRACT_REVIEW_TIER` 或 `TIER_DEFAULT`;无此行不 成裁决;模板 `record-recognisers.mjs --template`;前者只经写工具带 `--tier-evidence=`贴:子代理 (显式传该档 model)给输出文件;卡线程未起他 agent、未发消息、未调 Skill 才给本会话转录; 席位开席即调 Skill 恒不合;`verify-review-tier.mjs` 拒即子代理重跑 ⛔ 不改档名。 @@ -41,7 +41,7 @@ - 实质 head 各欠一轮完整 L2,发现逐条定 must-fix/should-fix/nit(无碍正确与契约);有前两级才由 原 L2 审核者读 delta;仅 nit 即终轮,记接受的偏差、转后续卡(`filing-gate.md`)或只改散文面。 - 另记作者:PR `user.login` 非 `objectstack-fleet[bot]` ⇒ ③ 注点名该 login(脱中继写),落地前读。 -- ③ 恒查(席位自读同):SQL 可下推处新增 id 物化或应用内 join 而无因由 ⇒ 记发现(AGENTS.md)。 +- ③ 恒查(席位自读同):SQL 可下推处新增 id 物化或应用内 join 无因由 ⇒ 记发现(AGENTS.md)。 - 简报从 `record-recognisers.mjs --brief-template` 起稿:只读条款与输入集内建,⛔ 不删 ⛔ 行。 - 独立性对、`Security-touching:`、`Rule-change-verified:` 行取值见 `--template`;子代理记采纳席位。 - ④ 恒由起草者之外的 agent 达档跑,起草已达档不免;喂入同上,⛔ 不喂起草者的结论。 @@ -52,7 +52,7 @@ - head 后移例外:纯重生成或只动散文面原记录续管,落 `Regen-provenance:` 行;余移或现 head 落 FAIL 而已挂 auto-merge ⇒ 派发席读到即照 AGENTS.md disarm 句撤挂,FAIL 记录点名欠撤挂;重挂照 ①。 - ② PR check 全绿,⛔ 非 required 子集;例外:merge-base 同签名的红不计、按设计而红见 SKILL.md。 -- 签名 = 失败步 + 首错行,读 base check runs 的 API ⛔ 不凭口述;主干红止血立单不变。 +- 签名 = 失败步 + 首错行,读 base check runs API ⛔ 不凭口述;主干红止血立单不变。 - 落地时仍欠 L2 的 PR 在落地 head 补审,L2 席或车道席按 (a)(b)(c) 接;FAIL ⛔ 不修已关 PR。 - 每条 must-fix 引该记录立卡、按发现定级;回退仅限主干红(p0,main-red 约定①)或安全边界。 diff --git a/.claude/skills/pm-dispatch/references/landing-operations.md b/.claude/skills/pm-dispatch/references/landing-operations.md index ca014676685..5965c8815f4 100644 --- a/.claude/skills/pm-dispatch/references/landing-operations.md +++ b/.claude/skills/pm-dispatch/references/landing-operations.md @@ -90,7 +90,7 @@ - p0 fix-forward 止血跳队,限机械、根因已核实;维护者可按 governed 例外人工直合一行修复。 - 止血非机械 ⇒ 锚卡点名归属车道、敲其信箱 `Notify: main-red`;根因卡恒归该车道。 - main-red 约定②:一个失败 check 只锚一张卡,先立者赢,后见者评论到锚卡,⛔ 不另立。 -- 约定③:锚卡一轮分诊(~60 分钟)无人认领 ⇒ 分诊与总监当轮轮报点名卡与归属车道。 +- 约定③:锚卡一轮分诊无人认领 ⇒ 分诊与总监当轮轮报点名卡与归属车道。 - 再一轮无人认领 ⇒ 分诊贴标准认领行、派一个 os-dev 只做止血;每轮一张,分诊不成车道。 - 止血 PR 的 L1/L2 归车道席或总监,⛔ 非分诊;Tier H 仍等审批人;车道席到场经认领行交回。 diff --git a/AGENTS.md b/AGENTS.md index 23865e6b2b9..a8ac48585ec 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -391,10 +391,10 @@ after a checkout-from-ref. Better, stage nothing: `git restore --source= -- ` (no `--staged`) writes the tree only, a lone unstaged `M`. -**A windowed history question ("how many commits on `` in ``"), or a containment +**A windowed history question ("how many commits on `` in ``"), or an `is-ancestor` containment one (`git-history.mjs ancestor`), goes through `scripts/pm/git-history.mjs` — answer, or REFUSE** -([why](docs/agents/multi-agent-discipline.md#windowed-history-on-a-shallow-clone)). `historyHorizon()` is the -read-only predicate for tools that answer their own question. +([why](docs/agents/multi-agent-discipline.md#shallow-clone-history)). `historyHorizon()` is the +read-only predicate for tools answering their own question. **Claim the issue BEFORE you write any code.** Every agent here shares one GitHub identity, so the assignee field is only a presence bit; the identity record is the `Claim:` comment — first diff --git a/docs/agents/multi-agent-discipline.md b/docs/agents/multi-agent-discipline.md index 63d6f7a163c..b8c5a0fe7af 100644 --- a/docs/agents/multi-agent-discipline.md +++ b/docs/agents/multi-agent-discipline.md @@ -59,13 +59,15 @@ because they read the tree, and a bare `git commit` builds from the **index** that deletes your own fix, in a PR whose body accurately describes a change it does not contain. -## Windowed history on a shallow clone +## Shallow-clone history ← [`AGENTS.md` › Multi-agent working discipline](../../AGENTS.md#multi-agent-working-discipline) A shallow clone answers windowed `git log`/`rev-list` questions from truncated history at exit 0 with no warning; the tool -proves the window is covered first. +proves the window is covered first. Containment (`merge-base --is-ancestor`) fails one way: a cut +only withholds an ancestor path, never invents one, so exit 0 stands in any clone while a "not an +ancestor" may be the cut; `git-history.mjs ancestor` proves the negative with a control leg or refuses. ## The shared identity’s accepted blind spot diff --git a/scripts/pm/check-owed-reviews.mjs b/scripts/pm/check-owed-reviews.mjs index 24cc5f9587f..52a8976a2f7 100644 --- a/scripts/pm/check-owed-reviews.mjs +++ b/scripts/pm/check-owed-reviews.mjs @@ -82,7 +82,8 @@ * own wait, and a `HOLD` beside `HELD` is one letter from a misread. * trigger the first that holds: (a) a hand-off line naming the current * head, or the waiting label — taken the same round; (b) the head - * has waited a full round (`TRIAGE_ROUND_MINUTES`) and no + * has waited a full round (`TRIAGE_ROUND_MINUTES`, the + * `seat-lifecycle.md` round line) and no * live hold names it; (c) the lane's seat has stood down or is * absent from the seat roster. A live hold holds (b) alone: the * lane that holds ends it with (a), and a lane gone is (c). @@ -115,6 +116,7 @@ import { GOVERNED_APPROVERS, NARROWING_FACE_LINE, narrowingDeclarationsIn, recor import { FLEET_BOT_LOGIN } from './check-handover.mjs'; import { readClause2Line } from './clause2-line.mjs'; import { parseSeat } from './fleet-roster.mjs'; +import { ROUND_MINUTES } from './round-open.mjs'; import { isL2ReviewLane } from './mailbox-open.mjs'; import { ghApi, readAllPages } from './gh-pages.mjs'; import { @@ -135,8 +137,8 @@ export const EXIT_USAGE = 2; export const DEFAULT_REPO = 'objectstack-ai/objectstack'; /** The waiting label the dispatching seat hangs at ACCEPT (`references/contract-review.md` 〈等 L2 标记〉). */ export const WAITING_LABEL = 'needs:contract-review'; -/** One full round — the rule's 「一轮(约 60 分钟)」, trigger (b). The name is kept: importers read it. */ -export const TRIAGE_ROUND_MINUTES = 60; +/** One full round, trigger (b): `round-open.mjs`'s `ROUND_MINUTES`, the number on `seat-lifecycle.md`'s round line — one source, never a second copy. The name is kept: importers read it. */ +export const TRIAGE_ROUND_MINUTES = ROUND_MINUTES; /** The seat posts' label (`seat-post-protocol.md`); `parseSeat` reads each one. */ export const SEAT_LABEL = 'pm:seat'; diff --git a/scripts/pm/round-open.mjs b/scripts/pm/round-open.mjs index 6ab6381a1aa..17e48e8c357 100644 --- a/scripts/pm/round-open.mjs +++ b/scripts/pm/round-open.mjs @@ -109,8 +109,9 @@ export const LIFECYCLE_PHRASES = Object.freeze([ '`round-open.mjs`', ]); /** The round length as that line spells it; the self-test reads the NUMBER out of it, so a changed figure is red. */ -export const ROUND_RULE = /一轮 (\d+) 分钟/g; -export const roundMinutesOfRule = (text) => [...text.matchAll(ROUND_RULE)].map((m) => Number(m[1])); +export const ROUND_RULE = /一轮 (\d+) 分钟/u; +/** Stateless: the export carries no `g`, so an importer's `.test()` keeps no `lastIndex`; the scan takes a local global copy. */ +export const roundMinutesOfRule = (text) => [...text.matchAll(new RegExp(ROUND_RULE.source, 'gu'))].map((m) => Number(m[1])); /** The legs this file cannot read, printed under every run. */ export const UNREAD_LEGS = Object.freeze([ @@ -577,7 +578,8 @@ export function main(argv, deps = {}) { // --------------------------------------------------------------------------- const SELF_TEST_BATTERIES = Object.freeze({ - 'the rule text: every phrase this file is built from is in the file that writes it': 3, + // 3 → 4 (#35237 item 21c): the exported ROUND_RULE is stateless — no `g`, so repeated `.test()` answers the same. + 'the rule text: every phrase this file is built from is in the file that writes it': 4, 'readings 1 and 2: the newest stand-down brief, the newest seat-signed comment after it': 7, 'reading 3: the newest claim of this seat by another session, and a push on a lane branch': 10, 'reading 4: the first closed lane card with a claim of this seat, timed by its session': 4, @@ -647,6 +649,7 @@ export function selfTest() { t('every reading this file takes is a phrase of seat-lifecycle.md 〈开轮互斥〉, the pointer included', LIFECYCLE_PHRASES.filter((p) => !lifecycle.includes(p)), []); t("⭐ one round's length is the number seat-lifecycle.md spells once, on its round rule line, and ROUND_MINUTES is that number", roundMinutesOfRule(lifecycle), [ROUND_MINUTES]); t('…and the reading follows the text: another figure on that line reads as that figure (so the pin above goes red), a line without the spelling reads none', [roundMinutesOfRule(lifecycle.replace(`一轮 ${ROUND_MINUTES} 分钟`, '一轮 45 分钟')), roundMinutesOfRule('未满一轮 ⇒ 自退(一轮约一小时)')], [[45], []]); + t('⛔ the exported ROUND_RULE carries no `g` or `y`: an importer\'s repeated `.test()` keeps no `lastIndex`, and the scan above still reads every figure', [ROUND_RULE.global || ROUND_RULE.sticky, [1, 2, 3].map(() => ROUND_RULE.test('一轮 60 分钟')), roundMinutesOfRule('一轮 60 分钟;一轮 45 分钟')], [false, [true, true, true], [60, 45]]); } battery('readings 1 and 2: the newest stand-down brief, the newest seat-signed comment after it');