diff --git a/scripts/pm/check-half-states.mjs b/scripts/pm/check-half-states.mjs index 8333ed612af..0295859bbc6 100644 --- a/scripts/pm/check-half-states.mjs +++ b/scripts/pm/check-half-states.mjs @@ -1124,8 +1124,8 @@ export function labelNames(issue) { } /** - * Lane labels retired INTO another lane, read as that lane everywhere this - * sweep compares a card's `domain:*` label with a seat's (maintainer ruling + * Lane labels retired INTO another lane, read as that lane wherever this + * sweep still reads a `domain:*` spelling (maintainer ruling * 2026-10-22, letter 乙: `domain:engine`, `domain:services` and `domain:cli` * fold into `domain:server`; `domain:rest`, never a lane of its own, is read * the same way by the maintainer's 2026-11-06 「车道的问题同意」). The @@ -1133,11 +1133,12 @@ export function labelNames(issue) { * in-flight cards keep their old label until they land, open cards are * relabelled in batches by triage after the merge lands, and seat posts are * retitled at each seat's next round — so for a while one lane is spelled five - * ways on the board. Every lane comparison below goes through - * {@link canonicalLane}, which is what lets a `domain:server` seat count a - * `domain:engine` queue card as its own, a seat still titled `domain:cli` see - * a claim on a `domain:server` card, and the census count a card carrying both - * spellings once. ⛔ An alias map, never a vocabulary: it says nothing about + * ways on the board. Since lanes became seats plus epics, no reader here + * judges a CARD by its `domain:*` label (a card is read by its intake, + * `cardIntakeKeys`), so the one reader left is a seat post's title + * ({@link seatLane}, through {@link canonicalLane}): a post still titled + * `domain:cli` reads as the `domain:server` seat, its number intact. + * ⛔ An alias map, never a vocabulary: it says nothing about * which labels EXIST (that is `scripts/pm/ensure-pm-labels.sh`), and the * cleanup PR that retires the label objects deletes these rows with them. The * write doors (`issue-create.mjs`, `label-write.mjs`, `fleet-write/dispatch.mjs`) @@ -8001,6 +8002,57 @@ export function seatLane(issue) { return { lane: canonicalLane(lane), foreign: elsewhere, seat }; } +/** + * The cards a seat post TAKES, read off its title — the seats-plus-epics + * reading that replaces a card's `domain:*` label (lanes become seats and + * epics; cards are picked by epic and area under the grade rules). Two key + * kinds, the spellings the live seat titles carry: `area:NAME` for each + * `area:*` token (`· area:data`, `· area:ai + area:workflow`), and `epic:#N` + * for each `epic #N` / `epic:#N` (`· epic #34571`). + * + * Only a seat on THIS board's repo lane has an intake here: `repo:NAME` + * (`#N` or `· seat N` beside it) whose NAME is the swept repo's, with no + * `@ elsewhere`. A `repo:cloud` seat's cards live on another board, and a + * `domain:*` seat post takes no card by label any more, so both answer `[]` + * — never guessed. Pure. + * + * @param {object} issue — the `pm:seat` post. + * @param {string} [repo] — `owner/name` of the board whose cards are counted. + * @returns {string[]} the intake keys, deduplicated, title order. + */ +export function seatIntakeKeys(issue, repo = SWEEP_REPO.repo) { + const title = String(issue?.title ?? ''); + const m = /^\[PM seat\]\s*(.*?)\s*—\s*(.*)$/u.exec(title); + if (!m) return []; + const name = m[1].trim(); + const lane = /^repo:([A-Za-z0-9._-]+)/u.exec(name); + const own = String(repo).split('/')[1] ?? ''; + const at = /@\s*(\S+)/u.exec(name); + if (!lane || lane[1].toLowerCase() !== own.toLowerCase() || (at && at[1].toLowerCase() !== own.toLowerCase())) return []; + const keys = [ + ...[...title.matchAll(/(? `area:${x[1]}`), + ...[...title.matchAll(/\bepic[ \t]*:?[ \t]*#([1-9][0-9]*)\b/giu)].map((x) => `epic:#${x[1]}`), + ]; + return [...new Set(keys)]; +} + +/** + * The intake keys a CARD falls under — the other half of `seatIntakeKeys`: + * each `area:*` label it carries, plus `epic:#N` when its sub-issue parent + * (`parent_issue_url`, on the REST issue row, so it costs no request) is + * issue N on the same repo. A `domain:*` label is not read. Pure. + * + * @param {object} issue — the card. + * @param {string} [repo] — `owner/name` the card lives on. + * @returns {string[]} + */ +export function cardIntakeKeys(issue, repo = SWEEP_REPO.repo) { + const keys = labelNames(issue ?? {}).filter((l) => typeof l === 'string' && /^area:[a-z0-9][a-z0-9-]*$/u.test(l)); + const parent = /\/repos\/([^/]+\/[^/]+)\/issues\/([1-9][0-9]*)$/u.exec(String(issue?.parent_issue_url ?? '')); + if (parent && parent[1].toLowerCase() === String(repo).toLowerCase()) keys.push(`epic:#${parent[2]}`); + return [...new Set(keys)]; +} + /** * Is this seat post declaring a HELD seat — a 🟢 with a real holder? * @@ -8071,11 +8123,20 @@ export function seatMarkerAgeMinutes(marker, nowMs = Date.now()) { * only for seats this row could actually speak about — 6 of the 12 open seat * posts at the 2026-08-25 census, and the only comment fetches the seat * population has ever bought (the H2 branch explicitly skips `pm:seat`). + * + * Two legs since lanes became seats plus epics: a seat whose title names an + * intake on this board (`seatIntakeKeys` — what H32 and H38 now count), and a + * seat on a `domain:*` lane this board can read (`seatLane`). That second leg + * judges no card: it only keeps a retired domain seat's thread read (H44's seat + * leg reads it anyway) until the post is retitled or closed, and H32 and H38 + * both skip such a post, since it names no intake. Both are HELD seat posts, so + * the population stays inside H44's seat leg and the shared memo still costs + * nothing extra. */ export function h32NeedsSeatComments(issue) { if (!labelNames(issue ?? {}).includes('pm:seat')) return false; if (!seatIsHeld(issue)) return false; - return !seatLane(issue).foreign; + return seatIntakeKeys(issue).length > 0 || !seatLane(issue).foreign; } /** @@ -8209,20 +8270,52 @@ export function seatWindowAudit(source) { }; } +/** + * H32's inventory for one seat: the cards whose intake keys (`cardIntakeKeys`) + * meet the seat's (`seatIntakeKeys`), counted once each however many keys + * they share. "Unclaimed" is `pm:queue` with NO assignee, the queue view's own + * dispatchable population; "in flight" is `pm:dispatched`. Pure, over the + * listings the sweep already holds, so it buys no request. + * + * @param {string[]} keys — the seat's intake keys. + * @param {Iterable} cards — the open cards this sweep listed. + * @param {string} [repo] + * @returns {{ unclaimed: number, inFlight: number }} + */ +export function seatIntakeInventory(keys, cards, repo = SWEEP_REPO.repo) { + const want = new Set(Array.isArray(keys) ? keys : []); + const out = { unclaimed: 0, inFlight: 0 }; + if (want.size === 0) return out; + for (const card of cards ?? []) { + if (!card || card.pull_request) continue; + if (!cardIntakeKeys(card, repo).some((k) => want.has(k))) continue; + const labels = labelNames(card); + if (labels.includes('pm:queue') && (card.assignees ?? []).length === 0) out.unclaimed += 1; + if (labels.includes('pm:dispatched')) out.inFlight += 1; + } + return out; +} + /** * H32 — null when clean, else the finding sentence. * + * The seat's lane is its INTAKE — the areas and epics its title names + * (`seatIntakeKeys`), never a `domain:*` label on the cards: a seat post with + * no intake on this board (a `domain:*` or `repo:cloud` seat, the triage seat) + * is out of scope, the harmless direction. + * * @param {object} issue — the seat post. * @param {{ body: string, createdAt: string|null }|null|undefined} marker — * the latest seat-post comment. `undefined` unconsulted, `null` unreadable. - * @param {{ unclaimed: number, inFlight: number }} lane — the lane inventory, - * counted off listings this sweep already holds. + * @param {{ unclaimed: number, inFlight: number }} lane — the intake inventory + * (`seatIntakeInventory`), counted off listings this sweep already holds. */ export function h32SeatIdleOverQueue(issue, marker, lane, nowMs = Date.now()) { if (!labelNames(issue ?? {}).includes('pm:seat')) return null; if (!seatIsHeld(issue)) return null; - const { lane: laneName, foreign } = seatLane(issue); - if (foreign || !laneName) return null; + const intake = seatIntakeKeys(issue); + if (intake.length === 0) return null; + const laneName = intake.map((k) => `\`${k}\``).join(' + '); const unclaimed = Number(lane?.unclaimed ?? 0); const inFlight = Number(lane?.inFlight ?? 0); @@ -8249,7 +8342,7 @@ export function h32SeatIdleOverQueue(issue, marker, lane, nowMs = Date.now()) { : `~${Math.round(age)} min since the seat's latest marker (threshold ${SEAT_IDLE_STALE_MINUTES} min)`; return ( - `\`pm:seat\` HELD, and its lane \`${laneName}\` has ${unclaimed} unclaimed \`pm:queue\` card(s) with ` + + `\`pm:seat\` HELD, and its intake ${laneName} has ${unclaimed} unclaimed \`pm:queue\` card(s) with ` + `NOTHING in flight — ${clock}. The board is asserting two things that cannot both be healthy: a lane ` + 'with dispatchable work and zero throughput, and a named holder on the clock for it. Neither half is ' + 'visible from any card — a queued card looks exactly like an ordinary queued card however long it has ' + @@ -8448,15 +8541,16 @@ export function isFleetCard(issue) { } /** - * Does this sub-issue INHERIT its parent's domain or grade (SKILL.md: 「sub-issue + * Does this sub-issue INHERIT its parent's area or grade (SKILL.md: 「sub-issue * 承父卡域 … 免审计评论」)? True when the parent row carries one of the card's - * own `domain:*` or `priority:*` labels. Pure; a parent that is not a row - * (null, undefined, the unreadable sentinel) inherits nothing. + * own `area:*` or `priority:*` labels — the area is what a first touch now + * routes by; a shared `domain:*` label inherits nothing. Pure; a parent that + * is not a row (null, undefined, the unreadable sentinel) inherits nothing. */ export function h74InheritsFromParent(issue, parent) { if (!parent || parent === H74_PARENT_UNREADABLE || !Array.isArray(parent.labels)) return false; const inherited = labelNames(parent); - return labelNames(issue).some((l) => (l.startsWith('domain:') || l.startsWith('priority:')) && inherited.includes(l)); + return labelNames(issue).some((l) => typeof l === 'string' && (l.startsWith('area:') || l.startsWith('priority:')) && inherited.includes(l)); } /** The heading a signed first-touch record carries — the filing card's spelling, `## Triage`. */ @@ -8485,7 +8579,7 @@ export function isTriageAuditRecord(text) { * filing card's 「`[maintainer]` cards」 read as SKILL.md's 非车队卡: a human * author with no seat signature is never first-touched this way); not a * main-red anchor card. The third exemption, a sub-issue inheriting its - * parent's domain or grade, costs a read and is judged in the predicate. + * parent's area or grade, costs a read and is judged in the predicate. */ export function h74SpeaksAbout(issue) { if (!issue || issue.pull_request) return false; @@ -8530,7 +8624,7 @@ export function needsTriageAuditComments(issue) { * `parent` carries FOUR input states (H45's three plus the unreadable * sentinel): `undefined` not read — the row judges without the sub-issue * exemption; `null` the documented 404, parentless; a row — exempt when the - * card inherits its domain or grade from it; `H74_PARENT_UNREADABLE` — the + * card inherits its area or grade from it; `H74_PARENT_UNREADABLE` — the * row fires UNJUDGED, never clean and never silent. * * ⛔ No angle-bracket fragment and no tracker number in the sentence: it is @@ -8550,7 +8644,7 @@ export function h74QueuedWithoutTriageAudit(issue, commentBodies, parent) { if (parent === H74_PARENT_UNREADABLE) { return ( `${UNJUDGED_MARKER} ${state} card with no triage audit record in either channel (both read) whose ` + - 'sub-issues PARENT read failed this sweep — whether it inherits a domain or grade from a parent is ' + + 'sub-issues PARENT read failed this sweep — whether it inherits an area or grade from a parent is ' + 'UNJUDGED, not settled. Read the parent by hand before acting: an unreadable relation is not an ' + 'absent one.' ); @@ -8574,7 +8668,7 @@ export function h74QueuedWithoutTriageAudit(issue, commentBodies, parent) { '— ⛔ never a silent wait, and never a report to the maintainer in the mailbox\'s place. Report-only: ⛔ ' + 'never a label, comment or body written from this script. Exempt by design: `tracking`, `pm:epic`, ' + '`pm:seat`, `qa-run`, `eval-run`, `status:parked`, `queue-flake-anchor` and `platform-checklist-watchdog` carriers; a non-fleet card (human ' + - 'author, no seat signature); a main-red anchor card; a sub-issue inheriting its parent\'s domain or grade.' + 'author, no seat signature); a main-red anchor card; a sub-issue inheriting its parent\'s area or grade.' ); } @@ -9291,7 +9385,8 @@ export function seatPostLastEventMs(seat, commentRows) { /** * The `Seat:` line of a claim body — the seat NUMBER the claiming PM sits on - * (`Seat: domain:#`, free-claim multi-seat), read with the same key-line + * (`Seat: repo:#`, `Seat: epic:##`, or a retired domain seat's + * `Seat: domain:#`; free-claim multi-seat), read with the same key-line * tolerance as `threadReadField` (leading bullet or blockquote, bold or code * decoration around the key). Three answers, and the middle one is the reason * this reader is not a one-liner: @@ -9305,7 +9400,9 @@ export function seatPostLastEventMs(seat, commentRows) { * TWO spellings reach it: a line-initial key naming no `#`, and a * declaration the key line cannot see at all (mid-sentence, inside a code * span, inside a subscript tag, behind a `> - ` prefix). - * · Otherwise the number the line names. + * · Otherwise the number the line names: the FIRST `#` of the payload, so a + * trailing note (`… (#35205)`) never moves it — except the epic shape + * `epic:##`, whose first `#` is the epic and whose seat is `k`. * * ⚠️ The second spelling of the second answer is the repair, and the cost it * removes is measured: a wrong answer that is a REAL seat does not surface as @@ -9322,26 +9419,39 @@ const CLAIM_SEAT_KEY_LINE = /^[ \t]*(?:[-*+][ \t]+)?>?[ \t]*(?:\*\*)?`?Seat`?(?: /** * PRESENCE only — consulted solely when the key line matched nothing, and it * ⛔ never yields a number. Case-SENSITIVE, and it demands the whole declared - * payload (`domain:#`), because off the line start there is no - * position left to tell a declaration from prose: the pinned control - * 「the seat: domain:services#2 is busy」 has to keep reading as seat 1. Pinned - * to the measured shape; an unmeasured variant it misses falls back to 1, - * which is the defect, so widen it on evidence rather than narrowing it. + * payload in one of the seat spellings live on the board — `repo:#` + * (a repo name may carry `.` and `-`, e.g. `repo:www.objectos.ai#2`), + * `epic:##`, and a retired domain seat's `domain:#` — because + * off the line start there is no position left to tell a declaration from + * prose: the pinned controls 「the seat: domain:services#2 is busy」 and + * 「the seat: repo:objectstack#2 is busy」 have to keep reading as seat 1. + * Pinned to the measured shapes; an unmeasured variant it misses falls back to + * 1, which is the defect, so widen it on evidence rather than narrowing it. */ -const CLAIM_SEAT_DECLARATION_ANYWHERE = /(?:\*\*)?`?Seat`?(?:\*\*)?[ \t]*:[ \t]*`?domain:[a-z0-9_-]+[ \t]*#\d/; +const CLAIM_SEAT_DECLARATION_ANYWHERE = /(?:\*\*)?`?Seat`?(?:\*\*)?[ \t]*:[ \t]*`?(?:domain:[a-z0-9_-]+|repo:[A-Za-z0-9._-]+|epic:#[1-9][0-9]*)[ \t]*#\d/; /** @returns {number|null} the seat number, 1 when NO declaration is present at all, null when one is present but unreadable. */ export function claimSeatNumber(body) { const text = String(body ?? ''); const m = CLAIM_SEAT_KEY_LINE.exec(text); if (!m) return CLAIM_SEAT_DECLARATION_ANYWHERE.test(text) ? null : 1; - const n = /#(\d+)\b/.exec(String(m[1] ?? '')); + const payload = String(m[1] ?? ''); + // An epic seat names its epic first: `epic:##` is seat k, never seat N. + const epic = /^`?epic:#[1-9][0-9]*#(\d+)\b/.exec(payload); + if (epic) return Number(epic[1]); + const n = /#(\d+)\b/.exec(payload); return n ? Number(n[1]) : null; } /** - * The newest `Claim:` on a lane, over the dispatched cards this sweep holds, - * restricted to the claims of ONE seat number. + * The newest `Claim:` on a seat's intake, over the dispatched cards this sweep + * holds, restricted to the claims of ONE seat number. + * + * A card is on the intake when its `cardIntakeKeys` (its `area:*` labels, plus + * `epic:#N` for a same-board sub-issue parent) meet the seat's + * `seatIntakeKeys` — the seats-plus-epics reading H71 and H32 use. ⛔ A card's + * `domain:*` label is no intake: the domain seats retired, so a card carrying + * only one is on no seat and its claim outruns no post. * * Free-claim multi-seat puts several PMs on one lane, one post each. A post is * behind only when a claim of ITS OWN seat outran it — another seat's claim is @@ -9364,21 +9474,21 @@ export function claimSeatNumber(body) { * LOCALLY here rather than requested as a two-label query — that query returns * the union and would over-count in the "too many" direction. * - * @param {string} lane — a `domain:*` label. + * @param {string|string[]} intake — the seat's intake keys (`seatIntakeKeys(post)`); + * a lone key may be passed bare. * @param {Iterable} issues — open cards this sweep already listed. * @param {Map} commentsByNumber — threads already in the cache. * @param {number} [seat=1] — the seat number whose claims count (`seatLane(post).seat`). * @returns {{ number: number, at: number }|null} the newest claim, or null. */ -export function newestLaneClaim(lane, issues, commentsByNumber, seat = 1) { +export function newestLaneClaim(intake, issues, commentsByNumber, seat = 1) { let best = null; - // The lane and the card's labels are compared through the alias map, so a - // card still carrying a retired spelling is on the lane that absorbed it. - const want = canonicalLane(lane); + const want = new Set((Array.isArray(intake) ? intake : [intake]).filter((k) => typeof k === 'string')); + if (want.size === 0) return null; for (const issue of issues ?? []) { const labels = labelNames(issue ?? {}); // Both conditions intersected locally — see the OR/AND note above. - if (!labels.includes('pm:dispatched') || !labels.some((l) => canonicalLane(l) === want)) continue; + if (!labels.includes('pm:dispatched') || !cardIntakeKeys(issue).some((k) => want.has(k))) continue; const rows = commentsByNumber?.get?.(issue.number); if (!rows) continue; // Only this seat's claims: the filter runs on the rows, the predicate is reused. @@ -9397,16 +9507,19 @@ export function newestLaneClaim(lane, issues, commentsByNumber, seat = 1) { * * @param {object} seat — the `pm:seat` post. * @param {number|null} seatAt — `T_seat` (`seatPostLastEventMs`). - * @param {{ number: number, at: number }|null} claim — the newest lane claim - * OF THIS POST'S SEAT NUMBER (`newestLaneClaim(lane, …, seatLane(seat).seat)`). + * @param {{ number: number, at: number }|null} claim — the newest intake claim + * OF THIS POST'S SEAT NUMBER (`newestLaneClaim(seatIntakeKeys(seat), …, seatLane(seat).seat)`). */ export function h38SeatPostStale(seat, seatAt, claim) { if (!labelNames(seat ?? {}).includes('pm:seat')) return null; - const { lane, foreign, seat: seatNo } = seatLane(seat ?? {}); - // A lane this board cannot count has no readable claim population here, so - // an absent claim would mean "unreadable", not "none" — H32's `foreign` - // reasoning, and the reason this row declines rather than reporting silence. - if (foreign || !lane) return null; + const intake = seatIntakeKeys(seat ?? {}); + const { seat: seatNo } = seatLane(seat ?? {}); + // A seat whose title names no intake on this board (a sibling board's lane, + // a retired `domain:*` seat, triage) has no readable claim population here, + // so an absent claim would mean "unreadable", not "none" — H32's reasoning, + // and the reason this row declines rather than reporting silence. + if (intake.length === 0) return null; + const lane = intake.map((k) => `\`${k}\``).join(' + '); if (!claim) return null; // ⛔ Both sides must be READABLE. This is an ORDER comparison, not an age, so // an unreadable stamp does not make the reading conservative — it makes it @@ -9417,7 +9530,7 @@ export function h38SeatPostStale(seat, seatAt, claim) { const behindHours = (claim.at - seatAt) / 3_600_000; return ( - `\`pm:seat\` post is STALE — its lane \`${lane}\` (seat ${seatNo}) carries a \`Claim:\` on #${claim.number} written ` + + `\`pm:seat\` post is STALE — its intake ${lane} (seat ${seatNo}) carries a \`Claim:\` on #${claim.number} written ` + `${behindHours.toFixed(1)}h AFTER this post's last event (claim ${new Date(claim.at).toISOString()}, ` + `post ${new Date(seatAt).toISOString()}). A shift dispatched work and did not record it, so every ` + 'number the post states — 在飞 / 队列 / 决策箱 / the round number — describes a round that has since ' + @@ -9529,8 +9642,10 @@ export function censusPageExhausted(batch) { } /** - * The lanes a card belongs to — `domain:*` for domain lanes and `repo:*` for - * single-lane seats, the same two spellings the seat posts name. + * The lanes a card belongs to — its intake (`cardIntakeKeys`: its `area:*` + * labels, plus `epic:#N` for a same-board sub-issue parent) and `repo:*` for + * single-lane seats, the spellings the seat posts name. ⛔ A `domain:*` label is + * no lane: the domain seats retired. * * A card carrying neither is bucketed under `(no lane)` rather than dropped: an * unrouted closed card with `pm:` residue is still residue, and silently @@ -9538,9 +9653,9 @@ export function censusPageExhausted(batch) { * a reader could not see. */ export function censusLanesOf(issue) { - // Through the alias map, deduplicated: a card carrying a retired spelling - // beside the lane that absorbed it is one lane, never two rows. - const lanes = [...new Set(labelNames(issue ?? {}).filter((l) => /^(?:domain|repo):/u.test(l)).map(canonicalLane))]; + // Deduplicated, so a card is one row per lane, never two. + const repoLanes = labelNames(issue ?? {}).filter((l) => typeof l === 'string' && /^repo:/u.test(l)); + const lanes = [...new Set([...cardIntakeKeys(issue ?? {}), ...repoLanes])]; return lanes.length > 0 ? lanes : ['(no lane)']; } @@ -15758,7 +15873,9 @@ export function h73SpeaksAbout(issue) { /** * H73 — null when clean, else the finding sentence naming the ruling id, its - * age and the `domain:*` seat that owes the exit. + * age and the intake that names the seat owing the exit: the card's `area:*` + * labels and its epic parent (`cardIntakeKeys`), which the seat posts' titles + * take — ⛔ never a `domain:*` label, which no seat takes cards by any more. * * ⛔ 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 @@ -15775,11 +15892,15 @@ export function h73RuledCardStillInBox(issue, nowMs = Date.now()) { ageHours === null ? 'its `Ruled:` line carries no readable UTC stamp (an unreadable age must not read as fresh)' : `recorded ~${Math.round(ageHours)}h ago (threshold ${RULED_IN_BOX_STALE_HOURS}h)`; - const domains = labelNames(issue).filter((l) => typeof l === 'string' && l.startsWith('domain:')); + // The epic parent is said, never numbered: the sentence carries no tracker number. + const intake = cardIntakeKeys(issue); + const areas = intake.filter((k) => k.startsWith('area:')).map((d) => `\`${d}\``); + const epic = intake.some((k) => k.startsWith('epic:')); + const named = [...areas, ...(epic ? ['the epic its sub-issue parent is'] : [])].join(' / '); const owes = - domains.length > 0 - ? `owed by the ${domains.map((d) => `\`${d}\``).join(' / ')} lane seat` - : 'owed by NO lane yet — the card carries no `domain:*` label, so the TRIAGE seat routes it first'; + intake.length > 0 + ? `owed by the seat whose post names ${named}` + : 'owed by NO seat yet — the card carries no `area:*` label and no epic parent, so the TRIAGE seat routes it first'; return ( `\`${DECISION_INBOX_LABEL}\` still on a card whose BODY carries a ruling record: ` + `\`${RULED_LINE_KEY}:\` ruling comment ${governing.id}, ${age}. The ruling is recorded and the exit ` + @@ -16229,9 +16350,15 @@ export function h70HeldSeatWithoutPatrol(issue) { /** * H71 — null when clean, else the finding sentence. * + * The card's lane is its intake (`cardIntakeKeys`: its `area:*` labels and its + * epic parent), matched against the intake keys the 🟢 seat posts' titles name + * (`seatIntakeKeys`) — ⛔ never a `domain:*` label, which no seat takes cards + * by any more. + * * @param {object} issue — the card. - * @param {Map} onDutyLanes — canonical lane → issue numbers of - * its 🟢 seat posts, read off the `pm:seat` listing this sweep holds. + * @param {Map} onDutyLanes — intake key (`area:NAME`, + * `epic:#N`) → issue numbers of the 🟢 seat posts naming it, read off the + * `pm:seat` listing this sweep holds. */ export function h71UnclaimedOnDutyLane(issue, onDutyLanes, nowMs = Date.now()) { if (!issue || issue.pull_request || issue.state === 'closed') return null; @@ -16242,7 +16369,7 @@ export function h71UnclaimedOnDutyLane(issue, onDutyLanes, nowMs = Date.now()) { // so "that seat claims it" would be the wrong remedy. if (H71_NOT_CANDIDATE_LABELS.some((l) => labels.includes(l))) return null; if ((issue.assignees ?? []).length > 0) return null; - const lanes = [...new Set(labels.filter((l) => /^domain:/u.test(l)).map(canonicalLane))]; + const lanes = cardIntakeKeys(issue); const held = lanes.filter((lane) => (onDutyLanes?.get(lane) ?? []).length > 0); if (held.length === 0) return null; const updated = Date.parse(issue.updated_at ?? ''); @@ -16254,7 +16381,7 @@ export function h71UnclaimedOnDutyLane(issue, onDutyLanes, nowMs = Date.now()) { ? 'an unreadable `updated_at` (which must not read as fresh)' : `no activity for ~${Math.round(ageHours)}h (threshold ${QUEUE_ON_DUTY_UNCLAIMED_HOURS}h; a lower bound on its time in the queue)`; return ( - `\`pm:queue\`, open and unassigned, with ${reading}, on a lane a 🟢 seat holds: ${seats}. A seat on duty ` + + `\`pm:queue\`, open and unassigned, with ${reading}, under an intake a 🟢 seat post names: ${seats}. A seat on duty ` + 'with cards in flight patrols every 45 minutes or less, and a patrol\'s first act is to claim up to its ' + '`batch` limit, so a card this old on its lane usually means the patrol is not running (H70 names a held ' + 'post with no `Patrol:` line) or the seat is full. ⚠️ A seat on STANDBY wakes on mailbox and PR events plus ' + @@ -16263,7 +16390,8 @@ export function h71UnclaimedOnDutyLane(issue, onDutyLanes, nowMs = Date.now()) { 'is not ready). ⚠️ Spare concurrency is NOT judged: no seat post states it machine-readably, so a full seat ' + 'reads the same as an idle one here. ⛔ Report-only: no label or assignee is written from this script. Out ' + 'of scope: an assigned queue card (H24), a `pm:epic` subtree card, a card awaiting a decision or a ' + - 're-triage (`needs-user-decision`, `pm:retriage`: not candidates), a lane with no 🟢 seat post.' + 're-triage (`needs-user-decision`, `pm:retriage`: not candidates), an area or epic no 🟢 seat post names ' + + '(a `domain:*` label alone is no intake).' ); } @@ -19516,7 +19644,8 @@ export function summaryLine(counts, findingCount) { 'of this one and costs no request of its own' + `${refRead < refTargets ? ' — each unread branch is named on its own card\'s row, never dropped' : ''}. ` + `Seat liveness (H32): marker thread read on ${seatsRead} of ${seatCandidates} HELD seat post(s) whose ` + - 'lane is countable on THIS board — a seat held for a sibling repo\'s lane is out of scope here (its ' + + 'intake (the areas and epics its title names) or lane is countable on THIS board — a seat held for a ' + + 'sibling repo\'s lane is out of scope here (its ' + 'inventory is unreadable from this sweep, so an empty-looking queue would mean nothing), and an ' + 'unread thread makes H32 decline to judge that seat rather than accuse it. ' + `Shared-file holds (H36): changed-file page read on ${counts.sharedFileProbed ?? 0} of ` + @@ -24561,47 +24690,27 @@ async function sweepInto(findings, seen, seenPrs, seenMerged, seenUnscoped, seen throw lastHoldError; } - // H32 (#11706) — the lane inventory, then the verdicts. Counted off the label - // pages this sweep already holds, so the whole row costs nothing beyond the - // gated seat-marker fetches above. + // H32 (#11706) — the intake inventory, then the verdicts. Counted off the + // label pages this sweep already holds, so the whole row costs nothing beyond + // the gated seat-marker fetches above. // - // "Unclaimed" is `pm:queue` with NO assignee, which is the queue view's own - // dispatchable population — an assigned `pm:queue` card is H24's - // contradiction and is deliberately NOT counted as work this seat could take - // (the claim protocol reads it as taken). Counting it would let one - // half-state manufacture another. - const laneInventory = new Map(); - const laneBucket = (lane) => { - if (!laneInventory.has(lane)) laneInventory.set(lane, { unclaimed: 0, inFlight: 0 }); - return laneInventory.get(lane); - }; - for (const issue of seen.values()) { - const labels = labelNames(issue); - // Through the alias map, deduplicated, so a retired spelling counts toward - // the lane that absorbed it and a card carrying both is counted once. - const lanes = [...new Set(labels.filter((l) => /^domain:/u.test(l)).map(canonicalLane))]; - if (lanes.length === 0) continue; - const unclaimed = labels.includes('pm:queue') && (issue.assignees ?? []).length === 0; - const inFlight = labels.includes('pm:dispatched'); - for (const lane of lanes) { - const bucket = laneBucket(lane); - if (unclaimed) bucket.unclaimed += 1; - if (inFlight) bucket.inFlight += 1; - } - } + // A seat's inventory is the cards under the areas and epics its title names + // (`seatIntakeInventory`), never a `domain:*` label on a card. "Unclaimed" is + // `pm:queue` with NO assignee, which is the queue view's own dispatchable + // population — an assigned `pm:queue` card is H24's contradiction and is + // deliberately NOT counted as work this seat could take (the claim protocol + // reads it as taken). Counting it would let one half-state manufacture + // another. for (const { issue, marker } of seatMarkers.values()) { - const { lane } = seatLane(issue); - const idle = h32SeatIdleOverQueue(issue, marker, laneInventory.get(lane) ?? { unclaimed: 0, inFlight: 0 }); + const idle = h32SeatIdleOverQueue(issue, marker, seatIntakeInventory(seatIntakeKeys(issue), seen.values())); if (idle) findings.push([issue, 'H32', idle]); } // H71 (#28642) — the card-side complement of H32, off the same listings: an - // unclaimed queue card gone quiet on a lane some 🟢 seat post holds. Free. + // unclaimed queue card gone quiet under an intake some 🟢 seat post names. Free. const onDutyLanes = new Map(); for (const issue of seen.values()) { if (!labelNames(issue).includes('pm:seat') || !seatOnDuty(issue)) continue; - const { lane, foreign } = seatLane(issue); - if (!lane || foreign) continue; - onDutyLanes.set(lane, [...(onDutyLanes.get(lane) ?? []), issue.number]); + for (const key of seatIntakeKeys(issue)) onDutyLanes.set(key, [...(onDutyLanes.get(key) ?? []), issue.number]); } for (const issue of seen.values()) { const waiting = h71UnclaimedOnDutyLane(issue, onDutyLanes); @@ -25280,14 +25389,17 @@ async function sweepInto(findings, seen, seenPrs, seenMerged, seenUnscoped, seen // different finding with a different remedy, and inventing it inside this row // would put an accusation of staleness on a post that correctly says it is // not running a shift. + // The seat's intake (`seatIntakeKeys`) is what its claims are read against, + // so a retired `domain:*` seat post in this population takes no row here. for (const { issue, rows } of seatMarkers.values()) { - const { lane, seat } = seatLane(issue); - if (!lane) continue; + const intake = seatIntakeKeys(issue); + if (intake.length === 0) continue; + const { seat } = seatLane(issue); // Free-claim multi-seat: the post is compared against ITS seat's claims only. const stale = h38SeatPostStale( issue, seatPostLastEventMs(issue, rows), - newestLaneClaim(lane, seen.values(), commentCache, seat), + newestLaneClaim(intake, seen.values(), commentCache, seat), ); if (stale) findings.push([issue, 'H38', stale]); } @@ -26238,8 +26350,9 @@ export const SELF_TEST_BATTERIES = Object.freeze({ // must END, the FAIL spellings, the fail-safe idiom. The battery registers 126 cases beside these rows. 'H43 hand-off timing': 103, // Registered with the seat-patrol rows (#28642), pin just under the count: two - // free readings, each with its firing controls and its out-of-scope arms inside. - 'H70/H71 seat patrol': 30, + // free readings, each with its firing controls and its out-of-scope arms inside; + // H71's intake readers (seat title, card labels and epic parent) add five. + 'H70/H71 seat patrol': 35, // Registered with the mailbox off-table row (#28675), pin just under the count: // the predicate over readings (firing, window boundary, unreadable stamp and // reading, the listing cap), the population predicate, the text's shape, the @@ -26260,8 +26373,9 @@ export const SELF_TEST_BATTERIES = Object.freeze({ // Registered with the ruled-card-in-the-box row (#29386), pin just under the // count: the firing case, the label / fence / anchoring / id controls each // beside its positive twin, the threshold boundary, the governing stamp, the - // re-entry line, the owing seat, the live record shapes, the text, the band. - 'H73 ruled card in the decision box': 25, + // re-entry line, the owing seat (read off the card's intake, a `domain:*` alone + // owing nothing), the live record shapes, the text, the band. + 'H73 ruled card in the decision box': 26, // Registered with the blocking-relation rows, pin AT the count: for // each of H77–H81 the firing case beside the control that silences it, the // stand-down for the neighbouring row (H4/H19 for H77, H73 for H81), the @@ -29379,25 +29493,30 @@ async function selfTest() { b(BATTERY28642, 'H70 band: registered as `state`, and the sweep really pushes it', `${familyBand('H70')}/${familyRegistryCoverage().emitted.includes('H70')}`, 'state/true'); const NOW71 = Date.parse('2026-11-01T10:29:00Z'); - const ON_DUTY71 = new Map([['domain:spec', [18917]]]); + const ON_DUTY71 = new Map([['area:data', [35557]]]); // The measured incident: a p1 card entered the queue at 05:56Z on a lane whose seat was held, unclaimed till 10:29Z. const card71 = (labels, extra = {}) => ({ ...issue(labels), number: 28560, state: 'open', updated_at: '2026-11-01T05:56:00Z', ...extra }); const row71 = (...args) => String(h71UnclaimedOnDutyLane(...args) ?? ''); - b(BATTERY28642, 'H71: the incident — unassigned `pm:queue` card on a 🟢 lane, quiet ~4.5h -> finding', typeof h71UnclaimedOnDutyLane(card71(['pm:queue', 'domain:spec', 'priority:p1']), ON_DUTY71, NOW71), 'string'); - b(BATTERY28642, 'H71: …and the row names the lane, its seat post and the age', [row71(card71(['pm:queue', 'domain:spec']), ON_DUTY71, NOW71).includes('`domain:spec` (#18917)'), row71(card71(['pm:queue', 'domain:spec']), ON_DUTY71, NOW71).includes('~5h')].join(), 'true,true'); - b(BATTERY28642, '⭐ H71: inside the window is clean — 1h59m quiet does not fire, 2h01m does', [h71UnclaimedOnDutyLane(card71(['pm:queue', 'domain:spec'], { updated_at: '2026-11-01T08:30:00Z' }), ON_DUTY71, NOW71), typeof h71UnclaimedOnDutyLane(card71(['pm:queue', 'domain:spec'], { updated_at: '2026-11-01T08:28:00Z' }), ON_DUTY71, NOW71)].join(), ',string'); - b(BATTERY28642, '⛔ H71: a lane with NO 🟢 seat post is out of scope however old the card', h71UnclaimedOnDutyLane(card71(['pm:queue', 'domain:ui']), ON_DUTY71, NOW71), null); - b(BATTERY28642, '⛔ H71: an ASSIGNED queue card is H24\'s, not this row\'s', h71UnclaimedOnDutyLane({ ...card71(['pm:queue', 'domain:spec']), assignees: [{ login: 'marchtian' }] }, ON_DUTY71, NOW71), null); - b(BATTERY28642, '⛔ H71: a `pm:epic` subtree card and a card not in `pm:queue` are out of scope', [h71UnclaimedOnDutyLane(card71(['pm:queue', 'pm:epic', 'domain:spec']), ON_DUTY71, NOW71), h71UnclaimedOnDutyLane(card71(['pm:blocked', 'domain:spec']), ON_DUTY71, NOW71)].every((v) => v === null), true); - b(BATTERY28642, '⛔ H71: a queued card awaiting a decision (`needs-user-decision`) is not a candidate', h71UnclaimedOnDutyLane(card71(['pm:queue', 'needs-user-decision', 'domain:spec']), ON_DUTY71, NOW71), null); - b(BATTERY28642, '⛔ H71: a queued card in re-triage (`pm:retriage`) is not a candidate', h71UnclaimedOnDutyLane(card71(['pm:queue', 'pm:retriage', 'domain:spec']), ON_DUTY71, NOW71), null); - b(BATTERY28642, '⛔ H71: a closed card, a PR row and a missing row are never judged', [h71UnclaimedOnDutyLane(card71(['pm:queue', 'domain:spec'], { state: 'closed' }), ON_DUTY71, NOW71), h71UnclaimedOnDutyLane(card71(['pm:queue', 'domain:spec'], { pull_request: {} }), ON_DUTY71, NOW71), h71UnclaimedOnDutyLane(undefined, ON_DUTY71, NOW71)].every((v) => v === null), true); - b(BATTERY28642, 'H71: an unreadable `updated_at` must not read as fresh', typeof h71UnclaimedOnDutyLane(card71(['pm:queue', 'domain:spec'], { updated_at: 'not a date' }), ON_DUTY71, NOW71), 'string'); - b(BATTERY28642, 'H71: a retired lane spelling reads through the alias map to the lane that absorbed it', typeof h71UnclaimedOnDutyLane(card71(['pm:queue', 'domain:engine']), new Map([['domain:server', [6367]]]), NOW71), 'string'); - b(BATTERY28642, 'H71 text: the dropped spare-concurrency condition is SAID, and the row stays report-only', ['Spare concurrency is NOT judged', 'Report-only', 'lower bound'].every((s) => row71(card71(['pm:queue', 'domain:spec']), ON_DUTY71, NOW71).includes(s)), true); + b(BATTERY28642, 'H71: the incident — unassigned `pm:queue` card on a 🟢 lane, quiet ~4.5h -> finding', typeof h71UnclaimedOnDutyLane(card71(['pm:queue', 'area:data', 'priority:p1']), ON_DUTY71, NOW71), 'string'); + b(BATTERY28642, 'H71: …and the row names the lane, its seat post and the age', [row71(card71(['pm:queue', 'area:data']), ON_DUTY71, NOW71).includes('`area:data` (#35557)'), row71(card71(['pm:queue', 'area:data']), ON_DUTY71, NOW71).includes('~5h')].join(), 'true,true'); + b(BATTERY28642, '⭐ H71: inside the window is clean — 1h59m quiet does not fire, 2h01m does', [h71UnclaimedOnDutyLane(card71(['pm:queue', 'area:data'], { updated_at: '2026-11-01T08:30:00Z' }), ON_DUTY71, NOW71), typeof h71UnclaimedOnDutyLane(card71(['pm:queue', 'area:data'], { updated_at: '2026-11-01T08:28:00Z' }), ON_DUTY71, NOW71)].join(), ',string'); + b(BATTERY28642, '⛔ H71: a lane with NO 🟢 seat post is out of scope however old the card', h71UnclaimedOnDutyLane(card71(['pm:queue', 'area:ux']), ON_DUTY71, NOW71), null); + b(BATTERY28642, '⛔ H71: an ASSIGNED queue card is H24\'s, not this row\'s', h71UnclaimedOnDutyLane({ ...card71(['pm:queue', 'area:data']), assignees: [{ login: 'marchtian' }] }, ON_DUTY71, NOW71), null); + b(BATTERY28642, '⛔ H71: a `pm:epic` subtree card and a card not in `pm:queue` are out of scope', [h71UnclaimedOnDutyLane(card71(['pm:queue', 'pm:epic', 'area:data']), ON_DUTY71, NOW71), h71UnclaimedOnDutyLane(card71(['pm:blocked', 'area:data']), ON_DUTY71, NOW71)].every((v) => v === null), true); + b(BATTERY28642, '⛔ H71: a queued card awaiting a decision (`needs-user-decision`) is not a candidate', h71UnclaimedOnDutyLane(card71(['pm:queue', 'needs-user-decision', 'area:data']), ON_DUTY71, NOW71), null); + b(BATTERY28642, '⛔ H71: a queued card in re-triage (`pm:retriage`) is not a candidate', h71UnclaimedOnDutyLane(card71(['pm:queue', 'pm:retriage', 'area:data']), ON_DUTY71, NOW71), null); + b(BATTERY28642, '⛔ H71: a closed card, a PR row and a missing row are never judged', [h71UnclaimedOnDutyLane(card71(['pm:queue', 'area:data'], { state: 'closed' }), ON_DUTY71, NOW71), h71UnclaimedOnDutyLane(card71(['pm:queue', 'area:data'], { pull_request: {} }), ON_DUTY71, NOW71), h71UnclaimedOnDutyLane(undefined, ON_DUTY71, NOW71)].every((v) => v === null), true); + b(BATTERY28642, 'H71: an unreadable `updated_at` must not read as fresh', typeof h71UnclaimedOnDutyLane(card71(['pm:queue', 'area:data'], { updated_at: 'not a date' }), ON_DUTY71, NOW71), 'string'); + b(BATTERY28642, '⛔ H71: a `domain:*` label alone is no intake — the card is silent even where a map key spells that label', h71UnclaimedOnDutyLane(card71(['pm:queue', 'domain:server']), new Map([['domain:server', [6367]], ['area:data', [35557]]]), NOW71), null); + b(BATTERY28642, '⭐ H71: an epic seat takes its subtree — a card whose sub-issue parent is the epic it names fires, naming `epic:#N`', row71(card71(['pm:queue'], { parent_issue_url: `https://api.github.com/repos/${SWEEP_REPO.repo}/issues/34571` }), new Map([['epic:#34571', [34584]]]), NOW71).includes('`epic:#34571` (#34584)'), true); + b(BATTERY28642, 'H71 control: …a parent on ANOTHER repo with the same number is not that epic — silent', h71UnclaimedOnDutyLane(card71(['pm:queue'], { parent_issue_url: 'https://api.github.com/repos/objectstack-ai/elsewhere-board/issues/34571' }), new Map([['epic:#34571', [34584]]]), NOW71), null); + b(BATTERY28642, 'seatIntakeKeys: the live title shapes — one area, two areas, an epic, a parenthesised note — on this board\'s repo lane', [`[PM seat] repo:${SWEEP_REPO.repo.split('/')[1]} · seat 7 — 🟢 os-tesla · 由 os-tesla 账户的项目负责 · area:data`, `[PM seat] repo:${SWEEP_REPO.repo.split('/')[1]} · seat 4 — 🟢 os-elon-musk · area:ai + area:workflow`, `[PM seat] repo:${SWEEP_REPO.repo.split('/')[1]} · seat 3 — 🟢 os-support-ai · epic #34571`, `[PM seat] repo:${SWEEP_REPO.repo.split('/')[1]} · seat 5 — 🟢 os-bill · area:ux(待 #35205 回填)`].map((title) => seatIntakeKeys(seat70(title, '')).join('+')).join(' | '), 'area:data | area:ai+area:workflow | epic:#34571 | area:ux'); + b(BATTERY28642, '⛔ seatIntakeKeys: no intake off this board or off a retired lane — `repo:` of another board, an `@ elsewhere` suffix, a `domain:*` seat, a bare seat and an unparseable title all answer none', [`[PM seat] repo:elsewhere-board · seat 2 — 🟢 os-warren · area:cloud`, `[PM seat] repo:${SWEEP_REPO.repo.split('/')[1]} @ elsewhere-board — 🟢 os-x · area:data`, '[PM seat] domain:spec · seat 3 — 🟢 os-sam · area:data', `[PM seat] repo:${SWEEP_REPO.repo.split('/')[1]} · seat 2 — 🟢 os-steve`, 'area:data seat registry'].map((title) => seatIntakeKeys(seat70(title, '')).length).join(), '0,0,0,0,0'); + b(BATTERY28642, 'cardIntakeKeys: every `area:*` label plus the same-repo epic parent; a `domain:*` and a foreign parent read as nothing', [cardIntakeKeys(card71(['area:data', 'domain:server', 'priority:p1'], { parent_issue_url: `https://api.github.com/repos/${SWEEP_REPO.repo}/issues/35205` })).join('+'), cardIntakeKeys(card71(['domain:server'], { parent_issue_url: 'https://api.github.com/repos/objectstack-ai/elsewhere-board/issues/9' })).length].join(), 'area:data+epic:#35205,0'); + b(BATTERY28642, 'H71 text: the dropped spare-concurrency condition is SAID, and the row stays report-only', ['Spare concurrency is NOT judged', 'Report-only', 'lower bound'].every((s) => row71(card71(['pm:queue', 'area:data']), ON_DUTY71, NOW71).includes(s)), true); b(BATTERY28642, 'seatOnDuty: 🟢 login and 🟢 Routine are on duty; vacant, paused and an unparseable title are not', [seatOnDuty(seat70(HELD70, '')), seatOnDuty(seat70('[PM seat] triage (objectstack-wide) — 🟢 Routine', '')), seatOnDuty(seat70('[PM seat] domain:ui — ⏳ vacant', '')), seatOnDuty(seat70('[PM seat] domain:ui — ⏸️ paused', '')), seatOnDuty(seat70('devx seat registry', ''))].join(), 'true,true,false,false,false'); b(BATTERY28642, 'H71 band: registered as `stall`, and the sweep really pushes it', `${familyBand('H71')}/${familyRegistryCoverage().emitted.includes('H71')}`, 'stall/true'); - b(BATTERY28642, 'H70/H71: neither is a loud finding — they never escalate a sweep', [isLoudFinding(row70(seat70(HELD70, STUB70))), isLoudFinding(row71(card71(['pm:queue', 'domain:spec']), ON_DUTY71, NOW71))].join(), 'false,false'); + b(BATTERY28642, 'H70/H71: neither is a loud finding — they never escalate a sweep', [isLoudFinding(row70(seat70(HELD70, STUB70))), isLoudFinding(row71(card71(['pm:queue', 'area:data']), ON_DUTY71, NOW71))].join(), 'false,false'); b(BATTERY28642, 'floor: this battery is DECLARED on the roster, with a positive pin', Object.prototype.hasOwnProperty.call(SELF_TEST_BATTERIES, BATTERY28642) && SELF_TEST_BATTERIES[BATTERY28642] > 0, true); // -- H72 (#28675): a recent mailbox comment the doorbell reader does not read. @@ -29499,7 +29618,7 @@ async function selfTest() { const card73 = (extra = {}) => ({ number: 28658, state: 'open', - labels: [{ name: DECISION_INBOX_LABEL }, { name: 'domain:server' }, { name: 'priority:p2' }], + labels: [{ name: DECISION_INBOX_LABEL }, { name: 'area:data' }, { name: 'priority:p2' }], body: `director#1 · os-support-ai · session_x\n${RULED73}\n\n## 维护者速读\n\n- 问题:…`, ...extra, }); @@ -29508,8 +29627,8 @@ async function selfTest() { const at73 = (iso) => Date.parse(iso); b(BATTERY29386, 'H73 fires: an open card carrying the decision label and a line-leading `Ruled:` record past the threshold', typeof h73(), 'string'); b(BATTERY29386, 'H73 row: names the ruling id, its age and the threshold', ['ruling comment 6566731522', 'recorded ~11h ago', `threshold ${RULED_IN_BOX_STALE_HOURS}h`].every((x) => row73().includes(x)), true); - b(BATTERY29386, 'H73 row: names the `domain:*` seat that owes the exit', row73().includes('owed by the `domain:server` lane seat'), true); - b(BATTERY29386, '⛔ H73: the SAME body without the decision label is clean', h73({ labels: [{ name: 'domain:server' }, { name: 'pm:queue' }] }), null); + b(BATTERY29386, 'H73 row: names the card\'s `area:*` as the intake of the seat that owes the exit', row73().includes('owed by the seat whose post names `area:data`'), true); + b(BATTERY29386, '⛔ H73: the SAME body without the decision label is clean', h73({ labels: [{ name: 'area:data' }, { name: 'pm:queue' }] }), null); b(BATTERY29386, '⛔ H73: a `Ruled:` line inside a backtick FENCE is a citation, not a record', h73({ body: `quoting the other card:\n\`\`\`\n${RULED73}\n\`\`\`\n` }), null); b(BATTERY29386, 'H73 control: …and the identical line with the fence removed fires, so the silence is the fence\'s', typeof h73({ body: `quoting the other card:\n${RULED73}\n` }), 'string'); b(BATTERY29386, '⛔ H73: a tilde fence is a fence too', h73({ body: `~~~text\n${RULED73}\n~~~` }), null); @@ -29523,8 +29642,9 @@ async function selfTest() { b(BATTERY29386, 'H73: …and the list form under that line is read too', h73({ body: `${RULED73}\n\n**Prior rulings on this card:**\n- 6566731522 — the old question\n` }), null); b(BATTERY29386, 'H73 control: …while the same line naming a DIFFERENT ruling still fires', typeof h73({ body: `${RULED73}\n\nPrior rulings on this card: 6400000001 — another ruling.` }), 'string'); b(BATTERY29386, 'H73 control: …and an id after a blank line below it is not that line\'s', typeof h73({ body: `Prior rulings on this card: none\n\n${RULED73}` }), 'string'); - b(BATTERY29386, 'H73: no `domain:*` label names the TRIAGE seat instead of inventing a lane', row73({ labels: [{ name: DECISION_INBOX_LABEL }] }).includes('the TRIAGE seat routes it first'), true); - b(BATTERY29386, 'H73: two `domain:*` labels are both named', row73({ labels: [{ name: DECISION_INBOX_LABEL }, { name: 'domain:spec' }, { name: 'domain:server' }] }).includes('`domain:spec` / `domain:server`'), true); + b(BATTERY29386, 'H73: no `area:*` label and no epic parent names the TRIAGE seat instead of inventing a seat', row73({ labels: [{ name: DECISION_INBOX_LABEL }] }).includes('the TRIAGE seat routes it first'), true); + b(BATTERY29386, '⛔ H73: a `domain:*` label alone owes nothing to a lane any more — the TRIAGE seat routes it, and the label is never named as an owner', [row73({ labels: [{ name: DECISION_INBOX_LABEL }, { name: 'domain:server' }] }).includes('the TRIAGE seat routes it first'), row73({ labels: [{ name: DECISION_INBOX_LABEL }, { name: 'domain:server' }] }).includes('`domain:server`')].join(), 'true,false'); + b(BATTERY29386, 'H73: an area and a same-repo epic parent are both named — the epic said, never numbered (the row is a GitHub body)', [row73({ parent_issue_url: `https://api.github.com/repos/${SWEEP_REPO.repo}/issues/35205` }).includes('`area:data` / the epic its sub-issue parent is'), /#[0-9]/.test(row73({ parent_issue_url: `https://api.github.com/repos/${SWEEP_REPO.repo}/issues/35205` }))].join(), 'true,false'); b(BATTERY29386, '⛔ H73 population: a closed card, a PR row, an unreadable `labels`, a missing row and an empty body are all silent, none a crash', [h73({ state: 'closed' }), h73({ pull_request: {} }), h73({ labels: undefined }), h73RuledCardStillInBox(undefined, NOW73), h73({ body: null })].every((v) => v === null), true); b(BATTERY29386, 'H73 reader: the live shapes read — a parenthesised re-ruling note and a seconds stamp', JSON.stringify([...ruledRecords('Ruled: 6439314592 · letter A (re-ruled from B, 6435350063) · 2026-10-27T10:22Z'), ...ruledRecords('- Ruled: 6398569691 · letter A · 2026-10-25T13:58:53Z')]), JSON.stringify([{ id: '6439314592', at: at73('2026-10-27T10:22Z') }, { id: '6398569691', at: at73('2026-10-25T13:58:53Z') }])); b(BATTERY29386, 'H73 text: no angle-bracket fragment and no tracker number — the row is written into a GitHub issue', /[<>]/.test(row73()) || /#[0-9]/.test(row73()), false); @@ -29716,7 +29836,7 @@ async function selfTest() { number: 29613, state: 'open', title: 'rest(record): the audit log row is dropped on bulk delete', - labels: [{ name: 'pm:queue' }, { name: 'domain:server' }, { name: 'priority:p2' }], + labels: [{ name: 'pm:queue' }, { name: 'area:data' }, { name: 'domain:server' }, { name: 'priority:p2' }], body: `${LANE_SIG74}\n\n## 维护者速读\n\n- 问题:…`, ...extra, }); @@ -29757,11 +29877,13 @@ async function selfTest() { } b(BATTERY74, 'H74 exempt control: a card ABOUT main-red (`pm-dispatch(main-red): …`) stays in the population — fires', typeof h74([], { title: 'pm-dispatch(main-red): when the anchor card closes, the held seats are rung' }), 'string'); b(BATTERY74, 'H74 exempt control: `red on main` without the prefix colon is prose, not an anchor — fires', typeof h74([], { title: 'rest: the export route goes red on main-like boards' }), 'string'); - // A sub-issue inheriting its parent's domain or grade — the read bought last. - const domainParent = { number: 29600, labels: [{ name: 'tracking' }, { name: 'domain:server' }] }; + // A sub-issue inheriting its parent's area or grade — the read bought last. + const areaParent = { number: 29600, labels: [{ name: 'tracking' }, { name: 'area:data' }] }; + const domainParent = { number: 29603, labels: [{ name: 'tracking' }, { name: 'domain:server' }] }; const gradeParent = { number: 29601, labels: [{ name: 'tracking' }, { name: 'priority:p2' }] }; - const strangerParent = { number: 29602, labels: [{ name: 'tracking' }, { name: 'domain:ui' }, { name: 'priority:p1' }] }; - b(BATTERY74, '⛔ H74 exempt: a sub-issue whose parent carries its `domain:*` is silent', h74QueuedWithoutTriageAudit(card74(), [], domainParent), null); + const strangerParent = { number: 29602, labels: [{ name: 'tracking' }, { name: 'area:ux' }, { name: 'domain:ui' }, { name: 'priority:p1' }] }; + b(BATTERY74, '⛔ H74 exempt: a sub-issue whose parent carries its `area:*` is silent', h74QueuedWithoutTriageAudit(card74(), [], areaParent), null); + b(BATTERY74, 'H74 exempt control: a parent sharing only the card\'s `domain:*` inherits nothing any more — fires', typeof h74QueuedWithoutTriageAudit(card74(), [], domainParent), 'string'); b(BATTERY74, '⛔ H74 exempt: …or its `priority:*`', h74QueuedWithoutTriageAudit(card74(), [], gradeParent), null); b(BATTERY74, 'H74 exempt control: a parent sharing NEITHER label inherits nothing — fires', typeof h74QueuedWithoutTriageAudit(card74(), [], strangerParent), 'string'); b(BATTERY74, 'H74 exempt control: a parentless card (the documented 404) fires, and an unread parent fires as before', [typeof h74QueuedWithoutTriageAudit(card74(), [], null), typeof h74([])].join(), 'string,string'); @@ -32587,6 +32709,10 @@ async function selfTest() { const SIBLING_BOARD = OWN_BOARD === 'objectui' ? 'objectstack' : 'objectui'; const ownLaneSeat = (status = '🟢 os-x') => seat(`[PM seat] domain:devx @ ${OWN_BOARD} — ${status}`); const siblingLaneSeat = (status = '🟢 os-x') => seat(`[PM seat] domain:devx @ ${SIBLING_BOARD} — ${status}`); + // The seats-plus-epics title H32 now counts: a repo-lane seat on THIS board naming its area intake (the live + // `area:build + area:fleet` shape). The `domain:*` HELD post above keeps driving the `seatLane` parse (seat number, + // the fetch leg a retired domain seat still buys); no row judges a card by it. + const AREA32 = `[PM seat] repo:${OWN_BOARD} — 🟢 os-sales · 由 os-sales 账户的项目负责 · area:build + area:fleet`; // The lane parse, across the three measured title shapes. t('H32 lane: a plain domain lane is own-board', seatLane(seat(HELD)).lane, 'domain:spec'); @@ -32608,22 +32734,37 @@ async function selfTest() { t('H32 held: a Routine seat is excluded (no claim cadence of its own)', seatIsHeld(seat('[PM seat] triage (objectstack-wide) — 🟢 Routine')), false); // The board halves — both required. - t('H32: held + idle lane + stale marker -> finding', typeof h32SeatIdleOverQueue(seat(HELD), marker('Round-start marker — R6.', 600), idleLane, NOW32), 'string'); - t('H32: …and it names the lane', h32row(seat(HELD), marker('Round-start marker — R6.', 600), idleLane, NOW32).includes('`domain:spec`'), true); - t('H32: …and the unclaimed count', h32row(seat(HELD), marker('Round-start marker — R6.', 600), idleLane, NOW32).includes('15 unclaimed'), true); - t('H32: work IN FLIGHT is a working seat -> clean', h32SeatIdleOverQueue(seat(HELD), marker('Round-start marker — R6.', 600), busy, NOW32), null); - t('H32: an EMPTY queue is a finished lane -> clean', h32SeatIdleOverQueue(seat(HELD), marker('Round-start marker — R6.', 600), { unclaimed: 0, inFlight: 0 }, NOW32), null); + t('H32: held + idle lane + stale marker -> finding', typeof h32SeatIdleOverQueue(seat(AREA32), marker('Round-start marker — R6.', 600), idleLane, NOW32), 'string'); + t('H32: …and it names the intake its title takes', h32row(seat(AREA32), marker('Round-start marker — R6.', 600), idleLane, NOW32).includes('its intake `area:build` + `area:fleet`'), true); + t('⛔ H32: a `domain:*` lane seat has no intake any more — out of scope however idle its marker', h32SeatIdleOverQueue(seat(HELD), marker('Round-start marker — R6.', 600), idleLane, NOW32), null); + t('⛔ H32: …and so are a sibling board\'s repo-lane seat and a bare repo-lane seat naming no area', [h32SeatIdleOverQueue(seat(`[PM seat] repo:${SIBLING_BOARD} — 🟢 os-x · area:data`), marker('Round-start marker', 600), idleLane, NOW32), h32SeatIdleOverQueue(seat(`[PM seat] repo:${OWN_BOARD} · seat 2 — 🟢 os-steve`), marker('Round-start marker', 600), idleLane, NOW32)].every((v) => v === null), true); + // The intake inventory: cards under the seat's areas and epics, each counted once; never a `domain:*` label. + const inv32 = (labels, extra = {}) => ({ ...issue(labels), ...extra }); + const CARDS32 = [ + inv32(['pm:queue', 'area:build']), + inv32(['pm:queue', 'area:build', 'area:fleet']), + inv32(['pm:queue', 'area:fleet'], { assignees: [{ login: 'os-x' }] }), + inv32(['pm:dispatched', 'area:data']), + inv32(['pm:queue', 'domain:spec']), + inv32(['pm:queue'], { parent_issue_url: `https://api.github.com/repos/${SWEEP_REPO.repo}/issues/34571` }), + ]; + t('H32 inventory: unclaimed under the intake, a two-area card once, an assigned queue card never, a `domain:*` card never', JSON.stringify(seatIntakeInventory(['area:build', 'area:fleet'], CARDS32)), JSON.stringify({ unclaimed: 2, inFlight: 0 })); + t('H32 inventory: in flight counts under the intake too, and an epic key counts its sub-issues', [JSON.stringify(seatIntakeInventory(['area:data'], CARDS32)), JSON.stringify(seatIntakeInventory(['epic:#34571'], CARDS32))].join(' '), '{"unclaimed":0,"inFlight":1} {"unclaimed":1,"inFlight":0}'); + t('H32 inventory: no intake counts nothing', JSON.stringify(seatIntakeInventory([], CARDS32)), JSON.stringify({ unclaimed: 0, inFlight: 0 })); + t('H32: …and the unclaimed count', h32row(seat(AREA32), marker('Round-start marker — R6.', 600), idleLane, NOW32).includes('15 unclaimed'), true); + t('H32: work IN FLIGHT is a working seat -> clean', h32SeatIdleOverQueue(seat(AREA32), marker('Round-start marker — R6.', 600), busy, NOW32), null); + t('H32: an EMPTY queue is a finished lane -> clean', h32SeatIdleOverQueue(seat(AREA32), marker('Round-start marker — R6.', 600), { unclaimed: 0, inFlight: 0 }, NOW32), null); t('H32: a vacant seat is out of scope however deep the queue', h32SeatIdleOverQueue(seat('[PM seat] domain:spec — ⏳ vacant'), marker('收班', 6000), idleLane, NOW32), null); t('H32: a FOREIGN lane is out of scope (its inventory is unreadable here)', h32SeatIdleOverQueue(siblingLaneSeat(), marker('Round-start marker', 600), idleLane, NOW32), null); t('H32: a non-seat card is out of scope', h32SeatIdleOverQueue({ ...issue(['pm:queue']), title: HELD }, marker('x', 600), idleLane, NOW32), null); // The threshold, at both edges of SEAT_IDLE_STALE_MINUTES. - t('H32: a marker inside the horizon -> clean', h32SeatIdleOverQueue(seat(HELD), marker('Round-start marker — R6.', SEAT_IDLE_STALE_MINUTES - 1), idleLane, NOW32), null); - t('H32: exactly at the horizon -> clean (strictly past it fires)', h32SeatIdleOverQueue(seat(HELD), marker('Round-start marker — R6.', SEAT_IDLE_STALE_MINUTES), idleLane, NOW32), null); - t('H32: one minute past -> finding', typeof h32SeatIdleOverQueue(seat(HELD), marker('Round-start marker — R6.', SEAT_IDLE_STALE_MINUTES + 1), idleLane, NOW32), 'string'); + t('H32: a marker inside the horizon -> clean', h32SeatIdleOverQueue(seat(AREA32), marker('Round-start marker — R6.', SEAT_IDLE_STALE_MINUTES - 1), idleLane, NOW32), null); + t('H32: exactly at the horizon -> clean (strictly past it fires)', h32SeatIdleOverQueue(seat(AREA32), marker('Round-start marker — R6.', SEAT_IDLE_STALE_MINUTES), idleLane, NOW32), null); + t('H32: one minute past -> finding', typeof h32SeatIdleOverQueue(seat(AREA32), marker('Round-start marker — R6.', SEAT_IDLE_STALE_MINUTES + 1), idleLane, NOW32), 'string'); // The measured cross-shift interval that must NOT fire: domain:engine's // 收班 23:10 -> 开轮 01:47 pair, the shape the 480-min horizon was set above. - t('H32: a 收班/开轮 turnaround inside the horizon is clean', h32SeatIdleOverQueue(seat(HELD), marker('**开轮 / ROUND-OPEN marker** — domain:engine seat', 157), idleLane, NOW32), null); + t('H32: a 收班/开轮 turnaround inside the horizon is clean', h32SeatIdleOverQueue(seat(AREA32), marker('**开轮 / ROUND-OPEN marker** — domain:engine seat', 157), idleLane, NOW32), null); // The wait exemption — structural, unbounded by time (grading's ruling). for (const [name, body] of [ @@ -32634,21 +32775,21 @@ async function selfTest() { ['a named Blocked-by', 'Round brief — the whole queue is Blocked-by: #123'], ['决策箱', '收班 — 队列 12,其中 12 在决策箱'], ]) { - t(`H32 exempt: a marker naming ${name} silences the row`, h32SeatIdleOverQueue(seat(HELD), marker(body, 6000), idleLane, NOW32), null); + t(`H32 exempt: a marker naming ${name} silences the row`, h32SeatIdleOverQueue(seat(AREA32), marker(body, 6000), idleLane, NOW32), null); } - t('H32 exempt: …and the exemption is UNBOUNDED by time', h32SeatIdleOverQueue(seat(HELD), marker('等裁决', 60_000), idleLane, NOW32), null); - t('H32: a marker with no wait declared is NOT exempt', typeof h32SeatIdleOverQueue(seat(HELD), marker('Round brief — 10 PR landed.', 6000), idleLane, NOW32), 'string'); + t('H32 exempt: …and the exemption is UNBOUNDED by time', h32SeatIdleOverQueue(seat(AREA32), marker('等裁决', 60_000), idleLane, NOW32), null); + t('H32: a marker with no wait declared is NOT exempt', typeof h32SeatIdleOverQueue(seat(AREA32), marker('Round brief — 10 PR landed.', 6000), idleLane, NOW32), 'string'); t('H32 exempt: seatDeclaresWait is case-folded', seatDeclaresWait('Everything is AWAITING the maintainer'), true); t('H32 exempt: …and plain prose declares nothing', seatDeclaresWait('Round 2 result — os-warren'), false); // The unread/unconsulted thread DECLINES — the one asymmetry against H4. - t('H32: an unconsulted thread declines to judge', h32SeatIdleOverQueue(seat(HELD), undefined, idleLane, NOW32), null); - t('H32: an UNREADABLE thread declines too (never a blind accusation)', h32SeatIdleOverQueue(seat(HELD), null, idleLane, NOW32), null); - t('H32: a seat with NO marker at all declines', h32SeatIdleOverQueue(seat(HELD), latestSeatMarker([]), idleLane, NOW32), null); + t('H32: an unconsulted thread declines to judge', h32SeatIdleOverQueue(seat(AREA32), undefined, idleLane, NOW32), null); + t('H32: an UNREADABLE thread declines too (never a blind accusation)', h32SeatIdleOverQueue(seat(AREA32), null, idleLane, NOW32), null); + t('H32: a seat with NO marker at all declines', h32SeatIdleOverQueue(seat(AREA32), latestSeatMarker([]), idleLane, NOW32), null); // An unreadable STAMP still fires — that is the #4690 direction, and it // differs from an unreadable THREAD because the wait exemption was still read. - t('H32: an unreadable marker stamp must not read as fresh', typeof h32SeatIdleOverQueue(seat(HELD), { body: 'Round-start marker', createdAt: 'not-a-date' }, idleLane, NOW32), 'string'); - t('H32: …and the row says so rather than printing a number', h32row(seat(HELD), { body: 'Round-start marker', createdAt: 'not-a-date' }, idleLane, NOW32).includes('unreadable marker timestamp'), true); + t('H32: an unreadable marker stamp must not read as fresh', typeof h32SeatIdleOverQueue(seat(AREA32), { body: 'Round-start marker', createdAt: 'not-a-date' }, idleLane, NOW32), 'string'); + t('H32: …and the row says so rather than printing a number', h32row(seat(AREA32), { body: 'Round-start marker', createdAt: 'not-a-date' }, idleLane, NOW32).includes('unreadable marker timestamp'), true); // latestSeatMarker — recency, with governingClaim's thread-order fallback. t('H32 marker: the NEWEST comment wins', latestSeatMarker([{ body: 'old', created_at: minsAgo(600) }, { body: 'new', created_at: minsAgo(10) }]).body, 'new'); @@ -32660,6 +32801,7 @@ async function selfTest() { // The gathering gate buys a fetch only for seats the row can speak about. t('H32 gate: a held own-board seat is a candidate', h32NeedsSeatComments(seat(HELD)), true); + t('H32 gate: a held repo-lane seat naming an intake on this board is a candidate; one naming none, or on a sibling board, is not', [h32NeedsSeatComments(seat(AREA32)), h32NeedsSeatComments(seat(`[PM seat] repo:${OWN_BOARD} · seat 2 — 🟢 os-steve`)), h32NeedsSeatComments(seat(`[PM seat] repo:${SIBLING_BOARD} — 🟢 os-x · area:data`))].join(), 'true,false,false'); t('H32 gate: a foreign-lane seat buys no fetch', h32NeedsSeatComments(siblingLaneSeat()), false); t('H32 gate: a vacant seat buys no fetch', h32NeedsSeatComments(seat('[PM seat] domain:spec — ⏳ vacant')), false); t('H32 gate: a non-seat card buys no fetch', h32NeedsSeatComments(issue(['pm:queue'])), false); @@ -32823,7 +32965,8 @@ async function selfTest() { // cards without touching it. The claims are what a silent shift leaves behind. const SEAT_AT_38 = Date.parse('2026-08-29T07:09:00Z'); const at38 = (iso) => Date.parse(iso); - const seat38 = (title = '[PM seat] domain:services — 🟢 os-elon · R4 派发中', extra = {}) => ({ + // A repo-lane seat on THIS board naming its area intake: the seats-plus-epics title H38 now reads. + const seat38 = (title = `[PM seat] repo:${OWN_BOARD} — 🟢 os-elon · area:data · R4 派发中`, extra = {}) => ({ number: 6021, title, labels: [{ name: 'pm:seat' }], @@ -32836,10 +32979,8 @@ async function selfTest() { // The measured specimen: a claim written ~24h after the post's last event. t('H38: a lane claim NEWER than the seat post -> finding', typeof h38SeatPostStale(seat38(), SEAT_AT_38, claim38(13398, '2026-08-30T07:30:00Z')), 'string'); - // The specimen post is titled `domain:services`; since the 2026-10-22 lane - // merge that spelling is an alias, and the finding names the lane it speaks - // for (the `domain:server lane aliases` battery below holds the controls). - t('H38: …and the finding names the lane, in its merged spelling', h38row(seat38(), SEAT_AT_38, claim38(13398, '2026-08-30T07:30:00Z')).includes('domain:server'), true); + // The finding names the intake the post takes, as its title spells it. + t('H38: …and the finding names the intake the post takes', h38row(seat38(), SEAT_AT_38, claim38(13398, '2026-08-30T07:30:00Z')).includes('its intake `area:data` (seat 1)'), true); t('H38: …and the card whose claim outran the post', h38row(seat38(), SEAT_AT_38, claim38(13398, '2026-08-30T07:30:00Z')).includes('#13398'), true); t('H38: …and states how far behind the post is', h38row(seat38(), SEAT_AT_38, claim38(13398, '2026-08-30T07:09:00Z')).includes('24.0h'), true); // ⛔ The row must not read as an accusation — the card is explicit that both @@ -32856,6 +32997,8 @@ async function selfTest() { // A lane on a sibling board has an unreadable claim population here, so an // absent claim would mean "unreadable", not "none" (H32's `foreign` rule). t('H38: a FOREIGN lane is out of scope', h38SeatPostStale(siblingLaneSeat(), SEAT_AT_38, claim38(1, '2026-08-30T07:30:00Z')), null); + t('H38: ⛔ a retired `domain:*` seat post is out of scope — it names no intake', h38SeatPostStale(seat38('[PM seat] domain:services — 🟢 os-elon · R4 派发中'), SEAT_AT_38, claim38(1, '2026-08-30T07:30:00Z')), null); + t('H38: a sibling board\'s repo seat naming an area is out of scope too', h38SeatPostStale(seat38(`[PM seat] repo:${SIBLING_BOARD} — 🟢 os-x · area:data`), SEAT_AT_38, claim38(1, '2026-08-30T07:30:00Z')), null); t('H38: a lane-less seat title is out of scope', h38SeatPostStale(seat38('[PM seat] triage (objectstack-wide) — 🟢 os-help'), SEAT_AT_38, claim38(1, '2026-08-30T07:30:00Z')), null); // ⛔ An ORDER comparison built on an unreadable stamp is a fabricated // ordering, not a conservative one — H33 settles this direction. @@ -32876,29 +33019,35 @@ async function selfTest() { const laneCard = (number, labels) => ({ number, labels: labels.map((name) => ({ name })), assignees: [], body: '', title: '' }); const CLAIM_ROW = [{ body: 'Claim: PM loop round 4\nSession: `session_x`', created_at: '2026-08-30T07:30:00Z' }]; const laneIssues = [ - laneCard(13398, ['pm:dispatched', 'domain:services']), - laneCard(13399, ['pm:dispatched', 'domain:devx']), - laneCard(13400, ['pm:queue', 'domain:services']), + laneCard(13398, ['pm:dispatched', 'area:data']), + laneCard(13399, ['pm:dispatched', 'area:build']), + laneCard(13400, ['pm:queue', 'area:data']), ]; const laneComments = new Map([[13398, CLAIM_ROW], [13399, CLAIM_ROW], [13400, CLAIM_ROW]]); - t('H38 lane: the newest claim on the lane is found', newestLaneClaim('domain:services', laneIssues, laneComments).number, 13398); - t('H38 lane: a claim on ANOTHER lane is not counted (OR-not-AND)', newestLaneClaim('domain:devx', laneIssues, laneComments).number, 13399); - t('H38 lane: a `pm:queue` card is not a dispatch claim', newestLaneClaim('domain:services', [laneCard(13400, ['pm:queue', 'domain:services'])], laneComments), null); - // `domain:skills`, not `domain:engine`: since the 2026-10-22 merge the latter - // is the same lane as the fixtures' `domain:services`, so it would be FOUND. - t('H38 lane: a lane with no dispatched cards is null', newestLaneClaim('domain:skills', laneIssues, laneComments), null); - t('H38 lane: an unfetched thread contributes nothing', newestLaneClaim('domain:services', laneIssues, new Map()), null); - t('H38 lane: the NEWEST of several claims wins', newestLaneClaim('domain:services', [laneCard(1, ['pm:dispatched', 'domain:services']), laneCard(2, ['pm:dispatched', 'domain:services'])], new Map([[1, [{ body: 'Claim: a', created_at: '2026-08-29T00:00:00Z' }]], [2, [{ body: 'Claim: b', created_at: '2026-08-30T00:00:00Z' }]]])).number, 2); + t('H38 lane: the newest claim on the lane is found', newestLaneClaim('area:data', laneIssues, laneComments).number, 13398); + t('H38 lane: a claim on ANOTHER lane is not counted (OR-not-AND)', newestLaneClaim('area:build', laneIssues, laneComments).number, 13399); + t('H38 lane: a `pm:queue` card is not a dispatch claim', newestLaneClaim('area:data', [laneCard(13400, ['pm:queue', 'area:data'])], laneComments), null); + t('H38 lane: a lane with no dispatched cards is null', newestLaneClaim('area:ux', laneIssues, laneComments), null); + t('H38 lane: an unfetched thread contributes nothing', newestLaneClaim('area:data', laneIssues, new Map()), null); + t('H38 lane: the NEWEST of several claims wins', newestLaneClaim('area:data', [laneCard(1, ['pm:dispatched', 'area:data']), laneCard(2, ['pm:dispatched', 'area:data'])], new Map([[1, [{ body: 'Claim: a', created_at: '2026-08-29T00:00:00Z' }]], [2, [{ body: 'Claim: b', created_at: '2026-08-30T00:00:00Z' }]]])).number, 2); // ⛔ The claim predicate is REUSED, not re-spelled: a comment that is not a // canonical `Claim:` is invisible here exactly as it is to H2 and H33. - t('H38 lane: prose mentioning a claim is not a claim', newestLaneClaim('domain:services', [laneCard(1, ['pm:dispatched', 'domain:services'])], new Map([[1, [{ body: 'the seat should claim: this card', created_at: '2026-08-30T00:00:00Z' }]]])), null); - t('H38 lane: an em-dash claim stays invisible (malformed by ruling)', newestLaneClaim('domain:services', [laneCard(1, ['pm:dispatched', 'domain:services'])], new Map([[1, [{ body: 'Claim — the skills seat', created_at: '2026-08-30T00:00:00Z' }]]])), null); - t('H38 lane: an unreadable claim stamp is not an ordering', newestLaneClaim('domain:services', [laneCard(1, ['pm:dispatched', 'domain:services'])], new Map([[1, [{ body: 'Claim: x', created_at: 'nope' }]]])), null); + t('H38 lane: prose mentioning a claim is not a claim', newestLaneClaim('area:data', [laneCard(1, ['pm:dispatched', 'area:data'])], new Map([[1, [{ body: 'the seat should claim: this card', created_at: '2026-08-30T00:00:00Z' }]]])), null); + t('H38 lane: an em-dash claim stays invisible (malformed by ruling)', newestLaneClaim('area:data', [laneCard(1, ['pm:dispatched', 'area:data'])], new Map([[1, [{ body: 'Claim — the skills seat', created_at: '2026-08-30T00:00:00Z' }]]])), null); + // The intake reading: a `domain:*` label alone puts a card on no seat; an epic parent and a multi-key intake do. + t('H38 lane: ⛔ a card carrying only `domain:*` is on no intake — its claim is not counted', newestLaneClaim('area:data', [laneCard(5, ['pm:dispatched', 'domain:services'])], new Map([[5, CLAIM_ROW]])), null); + t('H38 lane: a seat taking an epic sees the claim on that epic\'s sub-issue', newestLaneClaim(['epic:#34571'], [{ ...laneCard(6, ['pm:dispatched']), parent_issue_url: `https://api.github.com/repos/${SWEEP_REPO.repo}/issues/34571` }], new Map([[6, CLAIM_ROW]])).number, 6); + t('H38 lane: …but not on a sub-issue of another board\'s issue with that number', newestLaneClaim(['epic:#34571'], [{ ...laneCard(6, ['pm:dispatched']), parent_issue_url: 'https://api.github.com/repos/someone/else/issues/34571' }], new Map([[6, CLAIM_ROW]])), null); + t('H38 lane: a multi-key intake counts a claim under any of its keys', newestLaneClaim(['area:ux', 'area:build'], laneIssues, laneComments).number, 13399); + t('H38 lane: an empty intake sees nothing', newestLaneClaim([], laneIssues, laneComments), null); + t('H38 lane: an unreadable claim stamp is not an ordering', newestLaneClaim('area:data', [laneCard(1, ['pm:dispatched', 'area:data'])], new Map([[1, [{ body: 'Claim: x', created_at: 'nope' }]]])), null); // Free-claim multi-seat: several PMs on one lane, one post per seat, and a // post is compared only against claims of ITS seat number. The title suffix // and the claim's `Seat:` line are the two readings; both default to seat 1. const seat2Title = '[PM seat] domain:services · seat 2 — 🟢 os-b (session_y)'; + // The seat-2 post H38 judges: a repo-lane seat naming its intake (the domain title above drives the seatLane parse only). + const seat2Area = `[PM seat] repo:${OWN_BOARD} · seat 2 — 🟢 os-b (session_y) · area:data`; // `domain:server`: the title's `domain:services` is an alias since 2026-10-22. t('H38 seat: a `· seat N` title suffix parses as the LANE (merged spelling), not foreign', seatLane(seat38(seat2Title)).lane, 'domain:server'); t('H38 seat: …and is not foreign', seatLane(seat38(seat2Title)).foreign, false); @@ -32920,27 +33069,37 @@ async function selfTest() { t('H38 seat: a declaration mid-sentence in a code span is unreadable, ⛔ not seat 1', claimSeatNumber('**Claim:** dispatched by the `domain:spec` execution seat. `Seat: domain:spec#3` · claimed 2026-09-18T19:31Z'), null); t('H38 seat: …and the same declaration inside a subscript tag', claimSeatNumber('Seat: domain:spec#3'), null); // The two controls that keep the probe from swallowing the default: prose (above) needs the capital key, and a lane token alone is not a declaration. + // The seat spellings live today, mid-line: a `repo:` or `epic:` declaration the key line cannot see is PRESENT too. + t('H38 seat: a mid-line `repo:` declaration is unreadable, ⛔ not seat 1', claimSeatNumber('**Claim:** by the seat. `Seat: repo:objectstack#3` · claimed'), null); + t('H38 seat: …and so is a mid-line `epic:` declaration', claimSeatNumber('**Claim:** by the seat. `Seat: epic:#31527#1` · claimed'), null); + t('H38 seat: a line-initial `Seat: repo:objectstack#3` reads 3', claimSeatNumber('Claim: x\nSeat: repo:objectstack#3'), 3); + // The epic shape names its epic before its seat: `epic:##` is seat k. Every other spelling keeps the FIRST `#`. + t('H38 seat: a line-initial `Seat: epic:#31527#1` reads 1, ⛔ not the epic number', claimSeatNumber('Claim: x\nSeat: epic:#31527#1'), 1); + t('H38 seat: …backticked, `epic:#31527#2` reads 2', claimSeatNumber('Claim: x\nSeat: `epic:#31527#2`'), 2); + t('H38 seat: …and a trailing note does not move the epic seat', claimSeatNumber('Claim: x\nSeat: epic:#31527#1 (filed under #35205)'), 1); + t('H38 seat: a repo seat keeps its FIRST `#` — a trailing note does not move it', claimSeatNumber('Claim: x\nSeat: repo:objectstack#3 (filed under #35205)'), 3); + t('H38 seat: prose naming a repo seat is still not a declaration, so seat 1', claimSeatNumber('the seat: repo:objectstack#2 is busy'), 1); t('H38 seat: a lane token with no `Seat:` key is not a declaration, so the absent default holds', claimSeatNumber('Claim: x\nre-graded for `domain:spec#3` work'), 1); t('H38 seat: a body with no declaration at all is still seat 1 — every pre-line claim keeps its default', claimSeatNumber('Claim: x\nSession: `session_y`\nWorktree: `objectstack-issue-1`'), 1); const seatRow = (seatLine, iso) => [{ body: `Claim: PM loop round 1\nSession: \`session_x\`\n${seatLine}`, created_at: iso }]; - const oneCard = [laneCard(1, ['pm:dispatched', 'domain:services'])]; + const oneCard = [laneCard(1, ['pm:dispatched', 'area:data'])]; const seat2Claim = new Map([[1, seatRow('Seat: `domain:services#2`', '2026-08-30T00:00:00Z')]]); const seat1Claim = new Map([[1, seatRow('Branch: `claude/issue-1-a`', '2026-08-30T00:00:00Z')]]); - t('H38 seat: a SAME-seat newer claim is found (seat 2 post, seat 2 claim)', newestLaneClaim('domain:services', oneCard, seat2Claim, 2).number, 1); - t('H38 seat: ANOTHER seat\'s claim is not counted (seat 1 post, seat 2 claim)', newestLaneClaim('domain:services', oneCard, seat2Claim, 1), null); - t('H38 seat: an absent `Seat:` line is seat 1 — the seat 1 post sees it', newestLaneClaim('domain:services', oneCard, seat1Claim, 1).number, 1); - t('H38 seat: …and the seat 2 post does not', newestLaneClaim('domain:services', oneCard, seat1Claim, 2), null); - t('H38 seat: the default seat argument is 1, so every pre-existing call reads as before', newestLaneClaim('domain:services', laneIssues, laneComments).number, 13398); - t('H38 seat: an unreadable `Seat:` line matches no seat', newestLaneClaim('domain:services', oneCard, new Map([[1, seatRow('Seat: domain:services', '2026-08-30T00:00:00Z')]]), 1), null); + t('H38 seat: a SAME-seat newer claim is found (seat 2 post, seat 2 claim)', newestLaneClaim('area:data', oneCard, seat2Claim, 2).number, 1); + t('H38 seat: ANOTHER seat\'s claim is not counted (seat 1 post, seat 2 claim)', newestLaneClaim('area:data', oneCard, seat2Claim, 1), null); + t('H38 seat: an absent `Seat:` line is seat 1 — the seat 1 post sees it', newestLaneClaim('area:data', oneCard, seat1Claim, 1).number, 1); + t('H38 seat: …and the seat 2 post does not', newestLaneClaim('area:data', oneCard, seat1Claim, 2), null); + t('H38 seat: the default seat argument is 1, so every pre-existing call reads as before', newestLaneClaim('area:data', laneIssues, laneComments).number, 13398); + t('H38 seat: an unreadable `Seat:` line matches no seat', newestLaneClaim('area:data', oneCard, new Map([[1, seatRow('Seat: domain:services', '2026-08-30T00:00:00Z')]]), 1), null); const midLineClaim = new Map([[1, [{ body: '**Claim:** by the `domain:services` seat. `Seat: domain:services#3` · claimed', created_at: '2026-08-30T00:00:00Z' }]]]); - t('H38 seat: a mid-line declaration is invisible to the seat it names…', newestLaneClaim('domain:services', oneCard, midLineClaim, 3), null); - t('H38 seat: …and — the whole point — invisible to seat 1 too, so no post is rowed over it', newestLaneClaim('domain:services', oneCard, midLineClaim, 1), null); - t('H38 seat: the newest SAME-seat claim wins over a newer other-seat one', newestLaneClaim('domain:services', oneCard, new Map([[1, [...seatRow('Seat: domain:services#1', '2026-08-29T00:00:00Z'), ...seatRow('Seat: domain:services#2', '2026-08-30T00:00:00Z')]]]), 1).at, at38('2026-08-29T00:00:00Z')); + t('H38 seat: a mid-line declaration is invisible to the seat it names…', newestLaneClaim('area:data', oneCard, midLineClaim, 3), null); + t('H38 seat: …and — the whole point — invisible to seat 1 too, so no post is rowed over it', newestLaneClaim('area:data', oneCard, midLineClaim, 1), null); + t('H38 seat: the newest SAME-seat claim wins over a newer other-seat one', newestLaneClaim('area:data', oneCard, new Map([[1, [...seatRow('Seat: domain:services#1', '2026-08-29T00:00:00Z'), ...seatRow('Seat: domain:services#2', '2026-08-30T00:00:00Z')]]]), 1).at, at38('2026-08-29T00:00:00Z')); // End to end on the post: a seat-2 post is judged against the claim handed to it, and names its seat. - t('H38 seat: a seat-2 post behind a same-seat claim -> finding', typeof h38SeatPostStale(seat38(seat2Title), SEAT_AT_38, claim38(13398, '2026-08-30T07:30:00Z')), 'string'); - t('H38 seat: …and the finding names the seat', h38row(seat38(seat2Title), SEAT_AT_38, claim38(13398, '2026-08-30T07:30:00Z')).includes('seat 2'), true); + t('H38 seat: a seat-2 post behind a same-seat claim -> finding', typeof h38SeatPostStale(seat38(seat2Area), SEAT_AT_38, claim38(13398, '2026-08-30T07:30:00Z')), 'string'); + t('H38 seat: …and the finding names the seat', h38row(seat38(seat2Area), SEAT_AT_38, claim38(13398, '2026-08-30T07:30:00Z')).includes('seat 2'), true); t('H38 seat: …while the bare post names seat 1', h38row(seat38(), SEAT_AT_38, claim38(13398, '2026-08-30T07:30:00Z')).includes('seat 1'), true); - t('H38 seat: a seat-2 post with no same-seat claim -> clean', h38SeatPostStale(seat38(seat2Title), SEAT_AT_38, newestLaneClaim('domain:services', oneCard, seat1Claim, 2)), null); + t('H38 seat: a seat-2 post with no same-seat claim -> clean', h38SeatPostStale(seat38(seat2Area), SEAT_AT_38, newestLaneClaim('area:data', oneCard, seat1Claim, 2)), null); // -- Lane label aliases — the domain:server merge (maintainer ruling 2026-10-22, letter 乙) -- // @@ -32969,18 +33128,19 @@ async function selfTest() { b(BATTERY_SERVER, 'seat title: …and is not foreign', seatLane(seat38('[PM seat] domain:cli — ⏳ vacant')).foreign, false); b(BATTERY_SERVER, 'seat title: a retitled `domain:server · seat 3` post reads as itself', [seatLane(seat38('[PM seat] domain:server · seat 3 — 🟢 os-b')).lane, seatLane(seat38('[PM seat] domain:server · seat 3 — 🟢 os-b')).seat].join(), 'domain:server,3'); b(BATTERY_SERVER, 'seat title control: a `domain:spec` post is untouched by the alias', seatLane(seat38('[PM seat] domain:spec — 🟢 os-b')).lane, 'domain:spec'); - // The lane claim index, through the alias in BOTH directions. + // The claim index no longer reads a card's `domain:*` label in ANY spelling: a card is on a seat by its intake + // (`cardIntakeKeys`), so the alias map reaches seat TITLES only (above), never a card. const engineCard = [laneCard(7, ['pm:dispatched', 'domain:engine'])]; const serverCard = [laneCard(8, ['pm:dispatched', 'domain:server'])]; const aliasClaims = new Map([[7, CLAIM_ROW], [8, CLAIM_ROW]]); - b(BATTERY_SERVER, 'claim index: a `domain:server` seat sees the claim on a card still labelled `domain:engine`', newestLaneClaim('domain:server', engineCard, aliasClaims).number, 7); - b(BATTERY_SERVER, 'claim index: a seat still titled `domain:cli` sees the claim on a `domain:server` card', newestLaneClaim('domain:cli', serverCard, aliasClaims).number, 8); - b(BATTERY_SERVER, 'claim index: …and the claim on a sibling retired spelling', newestLaneClaim('domain:services', engineCard, aliasClaims).number, 7); - b(BATTERY_SERVER, 'claim index control: another lane still sees nothing (OR-not-AND holds through the alias)', newestLaneClaim('domain:spec', engineCard, aliasClaims), null); - b(BATTERY_SERVER, 'claim index control: a `pm:queue` card is still not a dispatch claim', newestLaneClaim('domain:server', [laneCard(9, ['pm:queue', 'domain:engine'])], new Map([[9, CLAIM_ROW]])), null); - // The census: one lane per card, whatever its spelling, and never twice. - b(BATTERY_SERVER, 'census: a `domain:cli` card is counted under `domain:server`', censusLanesOf(laneCard(1, ['domain:cli', 'pm:dispatched'])).join(), 'domain:server'); - b(BATTERY_SERVER, 'census: a card carrying an old AND the new spelling is ONE lane, not two', censusLanesOf(laneCard(1, ['domain:engine', 'domain:server'])).join(), 'domain:server'); + b(BATTERY_SERVER, 'claim index: ⛔ a card still labelled `domain:engine` is on no intake — no seat sees its claim', newestLaneClaim(['area:data'], engineCard, aliasClaims), null); + b(BATTERY_SERVER, 'claim index: ⛔ …nor a card labelled `domain:server`', newestLaneClaim(['area:data'], serverCard, aliasClaims), null); + b(BATTERY_SERVER, 'claim index: ⛔ a `domain:*` spelling handed in as the intake matches no card either', newestLaneClaim('domain:server', [...engineCard, ...serverCard], aliasClaims), null); + b(BATTERY_SERVER, 'claim index control: the same card with an `area:*` label beside its `domain:engine` is seen', newestLaneClaim(['area:data'], [laneCard(7, ['pm:dispatched', 'domain:engine', 'area:data'])], aliasClaims).number, 7); + b(BATTERY_SERVER, 'claim index control: a `pm:queue` card is still not a dispatch claim', newestLaneClaim(['area:data'], [laneCard(9, ['pm:queue', 'area:data'])], new Map([[9, CLAIM_ROW]])), null); + // The census: a `domain:*` label is no lane any more, in any spelling; one lane per card, never twice. + b(BATTERY_SERVER, 'census: ⛔ a `domain:cli` card alone buckets under `(no lane)` — a domain label is no lane', censusLanesOf(laneCard(1, ['domain:cli', 'pm:dispatched'])).join(), '(no lane)'); + b(BATTERY_SERVER, 'census: a card carrying `domain:*` beside `area:*` is counted under the area only', censusLanesOf(laneCard(1, ['domain:engine', 'domain:server', 'area:data'])).join(), 'area:data'); b(BATTERY_SERVER, 'census control: a `repo:*` lane passes through untouched', censusLanesOf(laneCard(1, ['repo:hotcrm'])).join(), 'repo:hotcrm'); b(BATTERY_SERVER, 'census control: a card with no lane still buckets under `(no lane)`', censusLanesOf(laneCard(1, ['pm:queue'])).join(), '(no lane)'); b(BATTERY_SERVER, 'floor: this battery is DECLARED on the frozen roster with a positive pin, and the roster floor rose to TEN with it', [Object.hasOwn(SELF_TEST_BATTERIES, BATTERY_SERVER), SELF_TEST_BATTERIES[BATTERY_SERVER] > 0, SELF_TEST_BATTERY_FLOOR === 10, Object.keys(SELF_TEST_BATTERIES).length >= SELF_TEST_BATTERY_FLOOR].join(), 'true,true,true,true'); @@ -33005,14 +33165,14 @@ async function selfTest() { const corpus = (rows, truncated = false) => ({ rows, truncated }); const censusOf = (byLabel, controlRows = 42) => summariseClosedResidue(new Map(byLabel), { controlRows }); - const DEVX = ['pm:dispatched', 'domain:devx']; + const DEVX = ['pm:dispatched', 'area:build']; const baseCensus = censusOf([ - ['pm:dispatched', corpus([censusCard(1, DEVX), censusCard(2, DEVX), censusCard(3, ['pm:dispatched', 'domain:spec'])])], - ['pm:queue', corpus([censusCard(1, ['pm:queue', 'domain:devx']), censusCard(9, ['pm:queue', 'domain:spec'])])], + ['pm:dispatched', corpus([censusCard(1, DEVX), censusCard(2, DEVX), censusCard(3, ['pm:dispatched', 'area:data'])])], + ['pm:queue', corpus([censusCard(1, ['pm:queue', 'area:build']), censusCard(9, ['pm:queue', 'area:data'])])], ]); t('H39: a label total is the count of its cards', baseCensus.rows.find((r) => r.label === 'pm:dispatched').total, 3); - t('H39: lanes are counted locally, per label', baseCensus.rows.find((r) => r.label === 'pm:dispatched').lanes.find((l) => l[0] === 'domain:devx')[1], 2); + t('H39: lanes are counted locally, per label', baseCensus.rows.find((r) => r.label === 'pm:dispatched').lanes.find((l) => l[0] === 'area:build')[1], 2); t('H39: rows sort by size so the worst lane leads', baseCensus.rows[0].label, 'pm:dispatched'); t('H39: the oldest closure is carried, for the "how old is this" question', baseCensus.rows[0].oldest.number, 1); // The contradictory pair, intersected LOCALLY — the endpoint's `labels` @@ -33058,7 +33218,9 @@ async function selfTest() { t('H39 paging: the ceiling is generous enough not to bind routinely', CENSUS_PAGE_CEILING >= 50, true); // Lane bucketing — an unrouted card is still residue and must not vanish. - t('H39 lanes: a domain label is a lane', censusLanesOf(censusCard(1, ['pm:queue', 'domain:spec'])).includes('domain:spec'), true); + t('H39 lanes: an area label is a lane', censusLanesOf(censusCard(1, ['pm:queue', 'area:data'])).includes('area:data'), true); + t('H39 lanes: ⛔ a domain label alone is no lane — the card is bucketed under `(no lane)`', censusLanesOf(censusCard(1, ['pm:queue', 'domain:spec'])).join(), '(no lane)'); + t('H39 lanes: a same-board epic parent is a lane', censusLanesOf(censusCard(1, ['pm:queue'], undefined, { parent_issue_url: `https://api.github.com/repos/${SWEEP_REPO.repo}/issues/34571` })).join(), 'epic:#34571'); t('H39 lanes: a repo label is a lane too (single-lane seats)', censusLanesOf(censusCard(1, ['pm:queue', 'repo:cloud'])).includes('repo:cloud'), true); t('H39 lanes: an unrouted card is bucketed, not dropped', censusLanesOf(censusCard(1, ['pm:queue']))[0], '(no lane)'); @@ -34115,7 +34277,7 @@ Mutual exclusion: \`get_comments\` page 747 → \`[]\`, page 746 = my own R+117 // between the two readings is STALE on page 1's `T_seat` and CLEAN on the // newest page's — the verdict flip this card is about. const CLAIM_18325 = { number: 18324, at: Date.parse('2026-09-14T20:00:00Z') }; - const LANE_SEAT_18325 = { ...SEAT_18325, title: '[PM seat] domain:devx @ objectstack — 🟢 os-project-manager' }; + const LANE_SEAT_18325 = { ...SEAT_18325, title: `[PM seat] repo:${SWEEP_REPO.repo.split('/')[1]} — 🟢 os-project-manager · area:build` }; t('H38 verdict: ⛔ on the OLD window the post reads STALE against a claim it already answered', typeof h38SeatPostStale(LANE_SEAT_18325, Date.parse('2026-09-14T11:41:59Z'), CLAIM_18325), 'string'); t('H38 verdict: ⭐ …and CLEAN once `T_seat` comes off the newest page', h38SeatPostStale(LANE_SEAT_18325, Date.parse('2026-09-15T08:00:00Z'), CLAIM_18325), null); // ⭐ The population is what did NOT move. Both gates read exactly as before. diff --git a/scripts/pm/check-owed-reviews.mjs b/scripts/pm/check-owed-reviews.mjs index d9a2721213c..8c8ad24ec49 100644 --- a/scripts/pm/check-owed-reviews.mjs +++ b/scripts/pm/check-owed-reviews.mjs @@ -64,8 +64,11 @@ * hold at `CONTRACT_REVIEW_HOLD_LIST_HOURS` or older on a WAIT row is * LISTED, for the triage round record — the age is a reading, never a * lapse. - * lane seat the lane of the PR's card (`domain:*`) against the open seat - * posts: `seated`, `stood-down`, `absent`, `unknown`. + * lane seat the intake of the PR's card — its `area:*` labels and its epic + * parent (`cardIntakeKeys`), ⛔ never a `domain:*` label — against + * the areas and epics the open seat posts' titles name on the PR's + * repo lane (`seatIntakeKeys`): `seated`, `stood-down`, `absent`, + * `unknown`. * L2 seat the L2 seats (`l2-review#N`, or `review#N`) against the same posts: `seated` * (and which), `stood-down`, `absent`, `unknown` (roster unread). * ⛔ No account is read: independence is per session, never per @@ -106,7 +109,7 @@ import process from 'node:process'; import { isEntrypoint } from '../invoked-as.mjs'; -import { CONTRACT_REVIEW_HEADING_MARKER, contractReviewVerdictLines, latestMarkedComment, readSignatureLine } from './check-half-states.mjs'; +import { cardIntakeKeys, CONTRACT_REVIEW_HEADING_MARKER, contractReviewVerdictLines, latestMarkedComment, readSignatureLine, seatIntakeKeys } from './check-half-states.mjs'; import { repoIdForSlug } from './check-governed-merges.mjs'; import { GOVERNED_APPROVERS, recordAuthorTrusted, recordTrustedAuthors } from './check-governed-queue-guard.mjs'; import { FLEET_BOT_LOGIN } from './check-handover.mjs'; @@ -285,14 +288,19 @@ export function declarationFaceOnly(limbs) { } /** - * The PR's lane seat, read off the card's `domain:*` label and the open seat - * posts. Pure. `seats` null means the roster could not be read. + * The PR's lane seat: the card's intake keys (`cardIntakeKeys` — its `area:*` + * labels and its epic parent) against the intake each open seat post's title + * names (`intake`, `seatIntakeKeys` over the PR's repo lane). Lanes are seats + * plus epics, so a seat takes a card by area or epic, ⛔ never by a `domain:*` + * label. Pure. `seats` null means the roster could not be read; a card with no + * intake has no lane seat to name (`unknown`). */ -export function laneSeatOf(cardLabels, seats) { - const lane = (Array.isArray(cardLabels) ? cardLabels : []).find((l) => /^domain:[a-z][a-z0-9-]*$/.test(l)) ?? null; - if (lane === null) return { lane: null, seat: 'unknown' }; +export function laneSeatOf(cardKeys, seats) { + const keys = (Array.isArray(cardKeys) ? cardKeys : []).filter((k) => typeof k === 'string' && /^(?:area:[a-z0-9][a-z0-9-]*|epic:#[1-9][0-9]*)$/.test(k)); + if (keys.length === 0) return { lane: null, seat: 'unknown' }; + const lane = keys.join(' / '); if (!Array.isArray(seats)) return { lane, seat: 'unknown' }; - const rows = seats.filter((s) => s?.lane === lane); + const rows = seats.filter((s) => Array.isArray(s?.intake) && s.intake.some((k) => keys.includes(k))); if (rows.some((s) => s.status === 'seated')) return { lane, seat: 'seated' }; return { lane, seat: rows.length > 0 ? 'stood-down' : 'absent' }; } @@ -317,7 +325,7 @@ export function reviewSeatsOf(seats) { * One row for one pull request, or null when its face owes no review. Pure. * * @param {object} pull a REST pull row plus `files` (paths), `comments`, `card`, `cardComments`, - * `cardLabels`, `headCommittedAt` (ISO) and `gaps` (reads that failed) + * `cardLabels`, `cardParent` (the card's `parent_issue_url`), `headCommittedAt` (ISO) and `gaps` (reads that failed) * @param {{ now: number, seats: object[]|null, repo?: string }} context */ export function owedReviewRow(pull, { now, seats, repo = DEFAULT_REPO }) { @@ -333,7 +341,7 @@ export function owedReviewRow(pull, { now, seats, repo = DEFAULT_REPO }) { const handoff = contractReviewHandoff(pull.comments, head); const claim = contractReviewClaims(pull.comments, head, { now }); const hold = contractReviewHold(pull.comments, head, { now }); - const lane = laneSeatOf(pull.cardLabels, seats); + const lane = laneSeatOf(cardIntakeKeys({ labels: pull.cardLabels ?? [], parent_issue_url: pull.cardParent ?? null }, repo), seats); const review = reviewSeatsOf(seats); const triggers = []; if (handoff.state === 'handed') triggers.push('(a) hand-off'); @@ -519,11 +527,12 @@ export function readSnapshot({ repo, board, get = ghApi }) { const pullsRead = list(`/repos/${repo}/pulls?state=open`); if (!pullsRead.ok) return { repo, pulls: [], seats: null, gaps: [`the open pull list (${pullsRead.error})`] }; const seatsRead = list(`/repos/${board}/issues?state=open&labels=${encodeURIComponent(SEAT_LABEL)}`); - const seats = seatsRead.ok ? seatsRead.value.map((post) => parseSeat(post, board)).filter((s) => s !== null) : null; + // Each row carries the intake its title names on THIS repo's lane — what the lane seat is read against. + const seats = seatsRead.ok ? seatsRead.value.map((post) => { const seat = parseSeat(post, board); return seat === null ? null : { ...seat, intake: seatIntakeKeys(post, repo) }; }).filter((s) => s !== null) : null; if (!seatsRead.ok) gaps.push(`the seat posts on ${board} (${seatsRead.error}) — trigger (c) and the L2 seats are not judged`); const pulls = []; for (const raw of pullsRead.value) { - const pull = { ...raw, files: [], comments: [], card: null, cardComments: [], cardLabels: [], headCommittedAt: null, gaps: [] }; + const pull = { ...raw, files: [], comments: [], card: null, cardComments: [], cardLabels: [], cardParent: null, headCommittedAt: null, gaps: [] }; const files = list(`/repos/${repo}/pulls/${raw.number}/files`); if (files.ok) pull.files = files.value.flatMap((f) => [f.filename, f.previous_filename].filter((p) => typeof p === 'string')); else pull.gaps.push(`files (${files.error})`); @@ -540,7 +549,10 @@ export function readSnapshot({ repo, board, get = ghApi }) { if (delivered.card !== null) { pull.card = delivered.card; const card = get(`/repos/${repo}/issues/${delivered.card}`); - if (card.ok) pull.cardLabels = labelNames(card.value); + if (card.ok) { + pull.cardLabels = labelNames(card.value); + pull.cardParent = card.value?.parent_issue_url ?? null; + } else pull.gaps.push(`card #${delivered.card} (${card.error})`); const cardComments = list(`/repos/${repo}/issues/${delivered.card}/comments`); if (cardComments.ok) pull.cardComments = cardComments.value; @@ -602,7 +614,8 @@ const SELF_TEST_BATTERIES = Object.freeze({ // 8 → 13 (#33705): the queue guard's author binding (an untrusted PASS unread, unable to shadow a trusted FAIL, an // approver's read) and its counted verdict reading (two lines `ambiguous`, an inline word alone `unstated`). 'the record: on this head (by whom, as stated), on an earlier head, none, unjudged': 13, - 'the triggers: (a) hand-off or label the same round, (b) a full round, (c) the lane seat': 10, + // 10 → 13: the lane seat read off the card's intake (`area:*`, epic parent), a `domain:*` alone naming none. + 'the triggers: (a) hand-off or label the same round, (b) a full round, (c) the lane seat': 13, // 10 → 14 → 16: S2 and S4 of PR #29967's contract review — an L2 seat on the PR's own account is barred (`lanes/l2-review.md` 独立性); an unread card thread leaves the bar unjudged. // 16 → 17 (#34003): the area-lease exception is named beside a barred seat, which stays barred — the maintainer's word is off GitHub. // 17 → 18: the L2 lane word `l2-review` beside its old spelling `review`, each seat named by the word its own post spells. @@ -654,12 +667,13 @@ export function selfTest() { comments: [], card: null, cardComments: [], - cardLabels: ['domain:ui'], + cardLabels: ['area:ux'], headCommittedAt: '2026-10-28T07:30:00Z', gaps: [], ...o, }); - const SEATED = [{ lane: 'domain:ui', status: 'seated' }, { lane: 'domain:skills', status: 'seated' }]; + // Seats plus epics: a seat row carries the intake its title names (`seatIntakeKeys`), and the card's `area:*` meets it. + const SEATED = [{ lane: 'repo:objectstack', seat: 5, intake: ['area:ux'], status: 'seated' }, { lane: 'repo:objectstack', seat: 1, intake: ['area:build', 'area:fleet'], status: 'seated' }]; const row = (o, seats = SEATED) => owedReviewRow(pull(o), { now: NOW, seats }); battery('arguments: modes and every refusal'); @@ -709,20 +723,23 @@ export function selfTest() { battery('the triggers: (a) hand-off or label the same round, (b) a full round, (c) the lane seat'); const fresh = '2026-10-28T12:30:00Z'; t('⭐ (a) a hand-off naming the current head ⇒ TAKE the same round, even 30 minutes in', (() => { const r = row({ headCommittedAt: fresh, comments: [handoff(HEAD, '2026-10-28T12:40:00Z')] }); return r.status === 'TAKE' && r.trigger === '(a) hand-off' && r.handoff.state === 'handed' && r.handoff.to === 'review#1' && r.taker === 'review#1'; })()); - t('⭐ (a) the waiting label ⇒ TAKE the same round, taken by the lane seat — the label names no seat', (() => { const r = row({ headCommittedAt: fresh, labels: [{ name: WAITING_LABEL }] }); return r.status === 'TAKE' && r.trigger === '(a) label' && r.taker === `the domain:ui seat (${LANE_OWN_NOTE})`; })()); + t('⭐ (a) the waiting label ⇒ TAKE the same round, taken by the lane seat — the label names no seat', (() => { const r = row({ headCommittedAt: fresh, labels: [{ name: WAITING_LABEL }] }); return r.status === 'TAKE' && r.trigger === '(a) label' && r.taker === `the area:ux seat (${LANE_OWN_NOTE})`; })()); t('⭐ a hand-off to a sibling lane seat names that seat as the taker — the fallback while no L2 seat is seated', (() => { const r = row({ headCommittedAt: fresh, comments: [handoff(HEAD, '2026-10-28T12:40:00Z', 'domain:ui#2')] }); return r.status === 'TAKE' && r.taker === 'domain:ui#2' && renderRow(r).includes('hand-off handed domain:ui#2 (6463525633)') && renderRow(r).includes('→ (a) hand-off · take: domain:ui#2'); })()); - t('⛔ a hand-off line still naming `triage` hands to nobody: unreadable, no (a) from it, and the taker is never triage', (() => { const r = row({ headCommittedAt: fresh, labels: [{ name: WAITING_LABEL }], comments: [handoff(HEAD, '2026-10-28T12:40:00Z', 'triage')] }); return r.handoff.state === 'unreadable' && r.trigger === '(a) label' && r.taker === `the domain:ui seat (${LANE_OWN_NOTE})` && !/take: [^·]*triage/.test(renderRow(r)); })()); + t('⛔ a hand-off line still naming `triage` hands to nobody: unreadable, no (a) from it, and the taker is never triage', (() => { const r = row({ headCommittedAt: fresh, labels: [{ name: WAITING_LABEL }], comments: [handoff(HEAD, '2026-10-28T12:40:00Z', 'triage')] }); return r.handoff.state === 'unreadable' && r.trigger === '(a) label' && r.taker === `the area:ux seat (${LANE_OWN_NOTE})` && !/take: [^·]*triage/.test(renderRow(r)); })()); t('a hand-off on an EARLIER head is no (a) — stale', (() => { const r = row({ headCommittedAt: fresh, comments: [handoff(HEAD2, '2026-10-28T12:40:00Z')] }); return r.handoff.state === 'stale' && r.status === 'WAIT'; })()); - t('⭐ (b) the head has waited a full triage round with no record and no claim ⇒ TAKE', (() => { const r = row({ headCommittedAt: '2026-10-28T11:59:00Z' }); return r.status === 'TAKE' && r.trigger === '(b) waited 61 min' && r.taker === `the domain:ui seat (${LANE_OWN_NOTE})`; })()); + t('⭐ (b) the head has waited a full triage round with no record and no claim ⇒ TAKE', (() => { const r = row({ headCommittedAt: '2026-10-28T11:59:00Z' }); return r.status === 'TAKE' && r.trigger === '(b) waited 61 min' && r.taker === `the area:ux seat (${LANE_OWN_NOTE})`; })()); t('under a full round, nothing else holding ⇒ WAIT (the lane\'s own), trigger none yet', (() => { const r = row({ headCommittedAt: '2026-10-28T12:01:00Z' }); return r.status === 'WAIT' && r.trigger === 'none yet' && r.waited === 59; })()); - t('⭐ (c) the lane seat stood down, or absent from the roster ⇒ TAKE, by the lane\'s next seat', row({ headCommittedAt: fresh }, [{ lane: 'domain:ui', status: 'paused' }]).trigger === '(c) lane seat stood-down' && row({ headCommittedAt: fresh }, [{ lane: 'domain:skills', status: 'seated' }]).trigger === '(c) lane seat absent' && row({ headCommittedAt: fresh }, [{ lane: 'domain:ui', status: 'paused' }]).taker === `the domain:ui seat next on duty (${LANE_OWN_NOTE})`); + t('⭐ (c) the lane seat stood down, or absent from the roster ⇒ TAKE, by the lane\'s next seat', row({ headCommittedAt: fresh }, [{ lane: 'repo:objectstack', seat: 5, intake: ['area:ux'], status: 'paused' }]).trigger === '(c) lane seat stood-down' && row({ headCommittedAt: fresh }, [{ lane: 'repo:objectstack', seat: 1, intake: ['area:build', 'area:fleet'], status: 'seated' }]).trigger === '(c) lane seat absent' && row({ headCommittedAt: fresh }, [{ lane: 'repo:objectstack', seat: 5, intake: ['area:ux'], status: 'paused' }]).taker === `the area:ux seat next on duty (${LANE_OWN_NOTE})`); t('an unread roster or a card with no lane judges no (c)', row({ headCommittedAt: fresh }, null).laneSeat === 'unknown' && row({ headCommittedAt: fresh, cardLabels: [] }).laneSeat === 'unknown'); + t('⛔ a card whose only lane reading is a `domain:*` label has no lane seat — unknown, no (c) — even beside a seat row spelling that label as its lane', (() => { const r = row({ headCommittedAt: fresh, cardLabels: ['domain:ui'] }, [{ lane: 'domain:ui', status: 'paused' }]); return r.laneSeat === 'unknown' && r.lane === null && r.status === 'WAIT'; })()); + t('⭐ an epic seat takes its subtree: the card\'s sub-issue parent on this repo meets an `epic:#N` intake; the same number on another repo does not', (() => { const EPIC = [{ lane: 'repo:objectstack', seat: 3, intake: ['epic:#34571'], status: 'seated' }]; const r = row({ headCommittedAt: fresh, cardLabels: [], cardParent: 'https://api.github.com/repos/objectstack-ai/objectstack/issues/34571' }, EPIC); const other = row({ headCommittedAt: fresh, cardLabels: [], cardParent: 'https://api.github.com/repos/objectstack-ai/cloud/issues/34571' }, EPIC); return r.lane === 'epic:#34571' && r.laneSeat === 'seated' && other.laneSeat === 'unknown'; })()); + t('the roster\'s intake is the PR repo\'s lane only: a `repo:cloud` seat naming `area:data` takes nothing here, the `repo:objectstack` one does', [seatIntakeKeys({ title: '[PM seat] repo:cloud · seat 4 — 🟢 os-bob · area:data' }, DEFAULT_REPO).length, seatIntakeKeys({ title: '[PM seat] repo:objectstack · seat 7 — 🟢 os-tesla · 由 os-tesla 账户的项目负责 · area:data' }, DEFAULT_REPO).join()].join(), '0,area:data'); t('an unknown commit time judges no (b); a PR opened after its head commit waits from its opening', row({ headCommittedAt: null }).waited === null && row({ headCommittedAt: null }).status === 'WAIT' && row({ headCommittedAt: '2026-10-28T07:30:00Z', created_at: '2026-10-28T12:30:00Z' }).waited === 30); battery('the L2 seat is the fallback: named by a hand-off or on its own delta, never on (b), (c), the label or the TIER_DEFAULT face'); const WITH_REVIEW = [...SEATED, { lane: 'review', seat: 2, status: 'seated' }, { lane: 'review', seat: 1, status: 'seated' }]; const rv = (o, seats = WITH_REVIEW) => owedReviewRow(pull(o), { now: NOW, seats }); - const LANE_TAKES = `the domain:ui seat (${LANE_OWN_NOTE})`; + const LANE_TAKES = `the area:ux seat (${LANE_OWN_NOTE})`; const oneRound = '2026-10-28T11:59:00Z'; const twoRounds = '2026-10-28T10:59:00Z'; const DECLARED = { files: ['packages/runtime/src/x.ts'], body: 'Clause-②: yes\nMetadata-protocol: added' }; @@ -734,12 +751,12 @@ export function selfTest() { t('⭐ (b) one round or two rounds waited with L2 seats seated ⇒ the LANE seat, the L2 seat never named; with a hand-off on the head ⇒ the seat it names', rv({ headCommittedAt: oneRound }).taker === LANE_TAKES && rv({ headCommittedAt: twoRounds }).taker === LANE_TAKES && !/review#/.test(rv({ headCommittedAt: twoRounds }).taker) && rv({ headCommittedAt: twoRounds, comments: [handoff(HEAD, '2026-10-28T12:40:00Z', 'review#2')] }).taker === 'review#2'); t('⭐ no L2 seat seated ⇒ the lane\'s own seat takes, at (b) and after — never triage', (() => { const r = rv({ headCommittedAt: twoRounds }, SEATED); return r.status === 'TAKE' && r.reviewSeat === 'absent' && r.taker === LANE_TAKES && !/triage/.test(renderRow(r)); })()); t('an L2 seat that stood down is no L2 seat: the lane seat takes, and the row says stood-down', (() => { const r = rv({ headCommittedAt: fresh, labels: [{ name: WAITING_LABEL }] }, [...SEATED, { lane: 'review', seat: 1, status: 'paused' }]); return r.reviewSeat === 'stood-down' && r.taker === LANE_TAKES; })()); - t('⭐ (c) the lane seat gone, an L2 seat seated ⇒ the lane\'s NEXT seat, never the L2 seat; none seated ⇒ the same', rv({ headCommittedAt: fresh }, [{ lane: 'review', status: 'seated' }]).taker === `the domain:ui seat next on duty (${LANE_OWN_NOTE})` && rv({ headCommittedAt: fresh }, [{ lane: 'domain:skills', status: 'seated' }]).taker === `the domain:ui seat next on duty (${LANE_OWN_NOTE})`); + t('⭐ (c) the lane seat gone, an L2 seat seated ⇒ the lane\'s NEXT seat, never the L2 seat; none seated ⇒ the same', rv({ headCommittedAt: fresh }, [{ lane: 'review', status: 'seated' }]).taker === `the area:ux seat next on duty (${LANE_OWN_NOTE})` && rv({ headCommittedAt: fresh }, [{ lane: 'repo:objectstack', seat: 1, intake: ['area:build', 'area:fleet'], status: 'seated' }]).taker === `the area:ux seat next on duty (${LANE_OWN_NOTE})`); t('the roster unread ⇒ the lane seat, and the row says unknown', (() => { const r = rv({ headCommittedAt: oneRound }, null); return r.reviewSeat === 'unknown' && r.taker === LANE_TAKES; })()); t('a hand-off names its seat whatever the roster says — a sibling lane seat under a seated L2 seat included', rv({ headCommittedAt: fresh, comments: [handoff(HEAD, '2026-10-28T12:40:00Z', 'domain:ui#2')] }).taker === 'domain:ui#2' && rv({ headCommittedAt: fresh, comments: [handoff(HEAD, '2026-10-28T12:40:00Z')] }, SEATED).taker === 'review#1'); t('⭐ a live claim by an L2 seat ⇒ HELD on the review side, no taker, nobody else starts', (() => { const r = rv({ labels: [{ name: WAITING_LABEL }], comments: [claimRow(REVIEWER, HEAD, '2026-10-28T12:18:56Z', `review#1 · os-zhuang · ${REVIEWER}`)] }); return r.status === 'HELD' && r.claim.holder.side === 'review' && r.taker === null && renderRow(r).includes('(review,'); })()); - t('⭐ the TIER_DEFAULT face (the `Clause-②: yes` line alone) never names an L2 seat: a hand-off naming review#1 ⇒ the lane seat, saying why; the same hand-off on the rules face ⇒ review#1', (() => { const d = rv({ ...DECLARED, headCommittedAt: fresh, comments: [handoff(HEAD, '2026-10-28T12:40:00Z')] }); const g = rv({ headCommittedAt: fresh, comments: [handoff(HEAD, '2026-10-28T12:40:00Z')] }); return d.status === 'TAKE' && d.face.join() === 'declaration' && d.tierName === 'TIER_DEFAULT' && d.taker === `the domain:ui seat (${TIER_DEFAULT_FACE_NOTE})` && g.taker === 'review#1'; })()); - t('the TIER_DEFAULT face: a hand-off to a SIBLING lane seat still names it; its own delta and (b) name the lane; the face is read off the limbs — the label beside it keeps it, a schema or governed path beside it ends it', rv({ ...DECLARED, headCommittedAt: fresh, comments: [handoff(HEAD, '2026-10-28T12:40:00Z', 'domain:ui#2')] }).taker === 'domain:ui#2' && rv({ ...DECLARED, comments: [signed(HEAD2, MICKEY)] }).taker === `the domain:ui seat (${TIER_DEFAULT_FACE_NOTE})` && rv({ ...DECLARED, headCommittedAt: oneRound }).taker === `the domain:ui seat (${TIER_DEFAULT_FACE_NOTE})` && [['declaration'], ['declaration', 'label'], ['rules', 'declaration'], ['schema', 'declaration'], ['label'], [], null].map(declarationFaceOnly).join() === 'true,true,false,false,false,false,false'); + t('⭐ the TIER_DEFAULT face (the `Clause-②: yes` line alone) never names an L2 seat: a hand-off naming review#1 ⇒ the lane seat, saying why; the same hand-off on the rules face ⇒ review#1', (() => { const d = rv({ ...DECLARED, headCommittedAt: fresh, comments: [handoff(HEAD, '2026-10-28T12:40:00Z')] }); const g = rv({ headCommittedAt: fresh, comments: [handoff(HEAD, '2026-10-28T12:40:00Z')] }); return d.status === 'TAKE' && d.face.join() === 'declaration' && d.tierName === 'TIER_DEFAULT' && d.taker === `the area:ux seat (${TIER_DEFAULT_FACE_NOTE})` && g.taker === 'review#1'; })()); + t('the TIER_DEFAULT face: a hand-off to a SIBLING lane seat still names it; its own delta and (b) name the lane; the face is read off the limbs — the label beside it keeps it, a schema or governed path beside it ends it', rv({ ...DECLARED, headCommittedAt: fresh, comments: [handoff(HEAD, '2026-10-28T12:40:00Z', 'domain:ui#2')] }).taker === 'domain:ui#2' && rv({ ...DECLARED, comments: [signed(HEAD2, MICKEY)] }).taker === `the area:ux seat (${TIER_DEFAULT_FACE_NOTE})` && rv({ ...DECLARED, headCommittedAt: oneRound }).taker === `the area:ux seat (${TIER_DEFAULT_FACE_NOTE})` && [['declaration'], ['declaration', 'label'], ['rules', 'declaration'], ['schema', 'declaration'], ['label'], [], null].map(declarationFaceOnly).join() === 'true,true,false,false,false,false,false'); t('⭐ the delta of its OWN record: a record on an earlier head signed by a seated L2 seat ⇒ that seat takes the head; with no record on an earlier head the same row ⇒ the lane', (() => { const r = rv({ comments: [signed(HEAD2, MICKEY)] }); return r.status === 'TAKE' && r.record.state === 'stale' && r.record.seat === 'review#1' && r.taker === 'review#1 (the delta of its own record 6911000001)' && rv({}).taker === LANE_TAKES; })()); t('⛔ not its own delta ⇒ the lane: the signer stood down or is not seated, the record signed by a lane seat, or carrying no signature; the signer read off the first line, a signature the reader refuses naming nobody', rv({ comments: [signed(HEAD2, MICKEY)] }, [...SEATED, { lane: 'review', seat: 1, status: 'paused' }, { lane: 'review', seat: 2, status: 'seated' }]).taker === LANE_TAKES && rv({ comments: [signed(HEAD2, `domain:ui#1 · os-bill · ${LANE}`)] }).taker === LANE_TAKES && rv({ comments: [recordRow(HEAD2, 'FAIL', 11)] }).taker === LANE_TAKES && signerSeatOf(signed(HEAD2, `review#2 · os-mickey · ${REVIEWER}`).body) === 'review#2' && signerSeatOf(signed(HEAD2, `Review#2 · os-mickey · ${REVIEWER}`).body) === null && signerSeatOf(recordRow(HEAD).body) === null); t('a record on THIS head is DONE — no taker at all, the signer\'s or anyone\'s', (() => { const r = rv({ comments: [signed(HEAD, MICKEY)] }); return r.status === 'DONE' && r.taker === null && r.record.seat === 'review#1'; })()); @@ -748,7 +765,7 @@ export function selfTest() { // Ruling A on #33258 (6917060639): independence is per SESSION — an L2 seat on the PR's own implementing account (the // attribution login) and one on its dispatching account (the card claim's signer) are seated like any other. const OWN = [...SEATED, { lane: 'review', seat: 1, status: 'seated', account: 'os-support-ai' }, { lane: 'review', seat: 2, status: 'seated', account: 'OS-Zhuang' }]; - t('⭐ same account, different session ⇒ eligible: L2 seats on the PR\'s implementing and dispatching accounts are seated and named, nothing printed as barred, no note under the report; the label row stays the lane\'s, and the seat on the implementing account takes the delta of its own record', (() => { const r = rv({ body: ATTR, card: 25922, cardComments: CLAIMED, headCommittedAt: fresh, labels: [{ name: WAITING_LABEL }] }, OWN); const delta = rv({ body: ATTR, card: 25922, cardComments: CLAIMED, comments: [signed(HEAD2, MICKEY)] }, OWN); const report = renderReport([r, delta], { repo: DEFAULT_REPO, now: NOW, read: { pulls: 2, drafts: 0 }, gaps: [] }); return r.status === 'TAKE' && r.reviewSeat === 'seated' && r.reviewSeats.join() === 'review#1,review#2' && !('reviewBarred' in r) && r.taker === LANE_TAKES && delta.taker === 'review#1 (the delta of its own record 6911000001)' && !report.some((l) => /barred|area-lease|⚖️/.test(l)) && rv({ body: ATTR, headCommittedAt: fresh }, [{ lane: 'review', seat: 1, status: 'seated', account: 'os-support-ai' }]).taker === `the domain:ui seat next on duty (${LANE_OWN_NOTE})`; })()); + t('⭐ same account, different session ⇒ eligible: L2 seats on the PR\'s implementing and dispatching accounts are seated and named, nothing printed as barred, no note under the report; the label row stays the lane\'s, and the seat on the implementing account takes the delta of its own record', (() => { const r = rv({ body: ATTR, card: 25922, cardComments: CLAIMED, headCommittedAt: fresh, labels: [{ name: WAITING_LABEL }] }, OWN); const delta = rv({ body: ATTR, card: 25922, cardComments: CLAIMED, comments: [signed(HEAD2, MICKEY)] }, OWN); const report = renderReport([r, delta], { repo: DEFAULT_REPO, now: NOW, read: { pulls: 2, drafts: 0 }, gaps: [] }); return r.status === 'TAKE' && r.reviewSeat === 'seated' && r.reviewSeats.join() === 'review#1,review#2' && !('reviewBarred' in r) && r.taker === LANE_TAKES && delta.taker === 'review#1 (the delta of its own record 6911000001)' && !report.some((l) => /barred|area-lease|⚖️/.test(l)) && rv({ body: ATTR, headCommittedAt: fresh }, [{ lane: 'review', seat: 1, status: 'seated', account: 'os-support-ai' }]).taker === `the area:ux seat next on duty (${LANE_OWN_NOTE})`; })()); t('⛔ an unreadable card thread leaves the record unjudged, so no own delta names an L2 seat — the lane takes; the seats still read seated, never a state of their own', (() => { const delta = rv({ card: 25922, cardComments: null, comments: [signed(HEAD2, MICKEY)] }, OWN); return delta.record.state === 'unjudged' && delta.taker === LANE_TAKES && delta.reviewSeat === 'seated' && delta.reviewSeats.join() === 'review#1,review#2'; })()); t('the printed row carries the L2-seat reading and the taker', renderRow(rv({ headCommittedAt: fresh, labels: [{ name: WAITING_LABEL }] })).includes(`L2 seat seated review#1,review#2 → (a) label · take: ${LANE_TAKES}`) && renderRow(rv({ headCommittedAt: fresh, labels: [{ name: WAITING_LABEL }] }, SEATED)).includes(`L2 seat absent → (a) label · take: ${LANE_TAKES}`)); @@ -785,18 +802,18 @@ export function selfTest() { const quiet = { number: 27200, draft: false, body: 'Fixes #27100\nClause-②: no', head: { sha: HEAD2, ref: 'claude/issue-27100-x' }, labels: [] }; const routes = { '/repos/objectstack-ai/objectstack/pulls?': { ok: true, value: [owing, quiet] }, - '/repos/objectstack-ai/objectstack/issues?': { ok: true, value: [{ number: 1, title: '[PM seat] domain:ui — 🟢 os-bill', body: '' }] }, + '/repos/objectstack-ai/objectstack/issues?': { ok: true, value: [{ number: 1, title: '[PM seat] repo:objectstack · seat 5 — 🟢 os-bill · area:ux', body: '' }] }, '/repos/objectstack-ai/objectstack/pulls/27136/files': { ok: true, value: [{ filename: '.github/workflows/ci.yml' }] }, '/repos/objectstack-ai/objectstack/pulls/27200/files': { ok: true, value: [{ filename: 'packages/runtime/src/x.ts' }] }, '/repos/objectstack-ai/objectstack/issues/27136/comments': { ok: true, value: [handoff(HEAD, '2026-10-28T07:43:43Z')] }, - '/repos/objectstack-ai/objectstack/issues/25922': { ok: true, value: { labels: [{ name: 'domain:ui' }] } }, + '/repos/objectstack-ai/objectstack/issues/25922': { ok: true, value: { labels: [{ name: 'area:ux' }, { name: 'domain:ui' }], parent_issue_url: 'https://api.github.com/repos/objectstack-ai/objectstack/issues/35205' } }, '/repos/objectstack-ai/objectstack/issues/25922/comments': { ok: true, value: [] }, '/repos/objectstack-ai/objectstack/commits/': { ok: true, value: { commit: { committer: { date: '2026-10-28T07:30:00Z' } } } }, }; const snap = readSnapshot({ repo: DEFAULT_REPO, board: DEFAULT_REPO, get: fake(routes) }); - t('the snapshot holds both pulls, the seat roster parsed, no gap', snap.pulls.length === 2 && snap.seats.length === 1 && snap.seats[0].lane === 'domain:ui' && snap.gaps.length === 0, JSON.stringify([snap.pulls.length, snap.seats, snap.gaps])); + t('the snapshot holds both pulls, the seat roster parsed, no gap', snap.pulls.length === 2 && snap.seats.length === 1 && snap.seats[0].lane === 'repo:objectstack' && snap.seats[0].intake.join() === 'area:ux' && snap.gaps.length === 0, JSON.stringify([snap.pulls.length, snap.seats, snap.gaps])); t('⭐ threads, card and commit are read ONLY for the pull that owes — the face is read first', paths.some((p) => p.startsWith('/repos/objectstack-ai/objectstack/issues/27136/comments')) && !paths.some((p) => p.startsWith('/repos/objectstack-ai/objectstack/issues/27200/comments')) && paths.some((p) => p.startsWith('/repos/objectstack-ai/objectstack/issues/25922/comments'))); - t('the card is the one the body delivers (`deliveredCardNumber`), and its lane label is read', snap.pulls[0].card === 25922 && snap.pulls[0].cardLabels.join() === 'domain:ui'); + t('the card is the one the body delivers (`deliveredCardNumber`), and its labels and sub-issue parent are read', snap.pulls[0].card === 25922 && snap.pulls[0].cardLabels.join() === 'area:ux,domain:ui' && snap.pulls[0].cardParent === 'https://api.github.com/repos/objectstack-ai/objectstack/issues/35205'); const broken = readSnapshot({ repo: DEFAULT_REPO, board: DEFAULT_REPO, get: fake({ ...routes, '/repos/objectstack-ai/objectstack/issues/27136/comments': { ok: false, error: 'HTTP 502' } }) }); t('⛔ a failed thread read is a GAP naming the PR and the read, and the record reads unjudged — never none', broken.gaps.some((g) => g.startsWith('#27136: comments')) && owedReviewRows(broken, { now: NOW })[0].record.state === 'unjudged'); const noList = readSnapshot({ repo: DEFAULT_REPO, board: DEFAULT_REPO, get: fake({}) }); @@ -825,7 +842,7 @@ export function selfTest() { t('the row prints the hold: who holds, the comment, its age, the (b) it holds and until what', renderRow(held).includes(`hold live ${LANE} (6472451890, 0 h old, holds (b) waited 61 min) until the last sibling PR merges`), renderRow(held)); t('⛔ a hold on an EARLIER head holds nothing — the head moved, (b) fires ⇒ TAKE', (() => { const r = row({ headCommittedAt: ripe, comments: [holdRow(HEAD2, heldAt)] }); return r.hold.state === 'stale' && r.status === 'TAKE' && r.trigger === '(b) waited 61 min' && r.hold.holds === null; })()); t('⭐ (a) still fires under a live hold — the label or a hand-off on this head is the holding lane ending its hold ⇒ TAKE', row({ headCommittedAt: ripe, labels: [{ name: WAITING_LABEL }], comments: [holdRow(HEAD, heldAt)] }).trigger === '(a) label' && row({ headCommittedAt: ripe, comments: [holdRow(HEAD, heldAt), handoff(HEAD, '2026-10-28T12:40:00Z')] }).trigger === '(a) hand-off'); - t('(c) still fires under a live hold — a lane seat that is gone holds nothing', row({ headCommittedAt: ripe, comments: [holdRow(HEAD, heldAt)] }, [{ lane: 'domain:ui', status: 'paused' }]).trigger === '(c) lane seat stood-down'); + t('(c) still fires under a live hold — a lane seat that is gone holds nothing', row({ headCommittedAt: ripe, comments: [holdRow(HEAD, heldAt)] }, [{ lane: 'repo:objectstack', seat: 5, intake: ['area:ux'], status: 'paused' }]).trigger === '(c) lane seat stood-down'); t('⛔ an unreadable hold holds nothing ⇒ (b) fires, and the row names the hold comment as unreadable', (() => { const r = row({ headCommittedAt: ripe, comments: [{ id: 7701, created_at: heldAt, body: 'Contract-review-hold: soon' }] }); return r.hold.state === 'unreadable' && r.status === 'TAKE' && renderRow(r).includes('hold unreadable (7701)'); })()); // A later comment quoting the template line at a line start (a round record, a seat note, a review) is unreadable. const quotedTemplate = { id: 7701, created_at: '2026-10-28T12:40:00Z', body: `triage#1 · os-zhuang · ${TRIAGE}\n\nRound record: lanes hold a head with\n- \`${CONTRACT_REVIEW_HOLD_TEMPLATE}\`` }; diff --git a/scripts/pm/ensure-pm-labels.sh b/scripts/pm/ensure-pm-labels.sh index f1d040bae31..d6682dbb33c 100644 --- a/scripts/pm/ensure-pm-labels.sh +++ b/scripts/pm/ensure-pm-labels.sh @@ -584,10 +584,10 @@ gh label create domain:rest -R objectstack-ai/objectstack -c bfd4f2 -d "Reti gh label create domain:cloud -R objectstack-ai/objectstack -c bfd4f2 -d "Touches cloud: the whole card is the cloud PM's (repo:cloud seat); no objectstack lane claims it" 2>/dev/null || true gh label create domain:cloud -R objectstack-ai/objectui -c bfd4f2 -d "Touches cloud: the whole card is the cloud PM's (repo:cloud seat); objectui lanes never claim it" 2>/dev/null || true # status:parked is the other half of parking: the backlog sweep's disjunct ③ -# (有 domain:* 无 pm-state) and check-half-states.mjs's H13 read it as the -# exemption (H13_EXEMPT_LABELS; SKILL.md 排除 `status:parked`), so a card that -# carries domain:cloud WITHOUT it is listed and "cured" with a pm state every -# fire, against the ruling above. The object exists in objectstack (auto-created) +# (有 area:* 无 pm-state) and check-half-states.mjs's H13 read it as the +# exemption (H13_EXEMPT_LABELS; SKILL.md 排除 `status:parked`), so a parked +# card (domain:cloud beside its area:cloud) WITHOUT it is listed and "cured" +# with a pm state every fire, against the ruling above. The object exists in objectstack (auto-created) # and was absent in objectui; the roster makes both. Colour matches `tracking`, # the other sweep-exempt label. Descriptions differ per repo on purpose: the # check:pm-label-desc-cap dry run wants one distinct description per parsed line. diff --git a/scripts/pm/first-touch-sweep.mjs b/scripts/pm/first-touch-sweep.mjs index 954562d94ec..271804fadd3 100644 --- a/scripts/pm/first-touch-sweep.mjs +++ b/scripts/pm/first-touch-sweep.mjs @@ -36,7 +36,8 @@ * ① bare — no `pm:*` label, no `needs-user-decision`, no `area:*` (other labels, `finding` among them, do not * make a card "touched": ① is NOT "no labels"); * ② `pm:queue` with no `area:*` — on a multi-lane board only (`MULTI_LANE_REPOS`); - * ③ an `area:*` with no pm state (`PM_EXCLUSIVE_STATE_LABELS`, `needs-user-decision` included); + * ③ an `area:*` with no pm state (`PM_EXCLUSIVE_STATE_LABELS`, `needs-user-decision` included, plus `pm:epic`: + * an epic is never dispatched, so it owes no position — H13 counts it as a state for the same phrase); * ④ `pm:queue` + `area:*` with no `priority:*`; * ⑤ created inside the window (`--since`) and carrying `pm:queue` or a `priority:*` that was applied in the same * minute the card was created — listed whoever applied it; the touch it is owed adds area and type, and a @@ -156,7 +157,9 @@ export function classify(issue, { repo, nowMs }) { const anyPm = labels.some((l) => l.startsWith('pm:')); const area = labels.some((l) => l.startsWith('area:')); const priority = labels.some((l) => l.startsWith('priority:')); - const state = PM_EXCLUSIVE_STATE_LABELS.some(has); + // ③'s state: a dispatch position, or `pm:epic` — a parent card is never dispatched, and H13 reads the same phrase + // with `pm:epic` counted. ⛔ ③ only: the type row and the area row keep their own epic readings. + const state = PM_EXCLUSIVE_STATE_LABELS.some(has) || has(EPIC_LABEL); const settled = Date.parse(issue?.updated_at ?? '') < nowMs - SETTLE_MS; const hits = []; if (!anyPm && !has(DECISION_INBOX_LABEL) && !area) hits.push(1); @@ -438,7 +441,8 @@ function rearmThroughProxy(args) { const SELF_TEST_BATTERIES = Object.freeze({ 'the rule text: every phrase this file is built from is in the file that writes it': 3, - 'the classifier: ①–④ exactly as written — ① is not "no labels", ③ is asked, exclusions first, ②③④ settle': 20, + // 20 → 22: ③ counts `pm:epic` as a state (H13's reading of the same phrase), with its stateless control. + 'the classifier: ①–④ exactly as written — ① is not "no labels", ③ is asked, exclusions first, ②③④ settle': 22, 'the fifth: created in the window, pm:queue or priority:* applied in the creation minute, whoever applied it — the touch it is owed adds area and type and keeps a grade a person set': 8, 'the walk: every page, pull requests dropped, the count checked — INCOMPLETE on any gap, never clean': 10, 'the CLI: what a typo must never mean, and the exits a patrol reads': 9, @@ -490,6 +494,8 @@ export async function selfTest() { t('⭐ ③ an area with no state — the stateless strip', c(['area:fleet', 'priority:p1']), [3]); t('③ needs-user-decision IS a state', c(['area:fleet', 'needs-user-decision']), []); t('③ pm:awaiting-maintainer IS a state', c(['area:fleet', 'pm:awaiting-maintainer']), []); + t('⭐ ③ pm:epic IS a state — an `area:*` epic with a grade and no position draws no ③ row, as H13 reads it', c(['area:fleet', 'pm:epic', 'priority:p1']), []); + t('③ control: the same `area:*` card with no state at all still draws its ③ row', c(['area:fleet', 'priority:p1']), [3]); t('④ queued, routed, ungraded', c(['area:data', 'pm:queue']), [4]); t('a routed, graded, queued card is owed nothing', c(['area:data', 'pm:queue', 'priority:p3']), []); t('②③④ wait ~2 min after the last update: a card mid-write is not owed', [c(['area:fleet'], { updated_at: FRESH }), c(['pm:queue'], { updated_at: FRESH })], [[], []]); diff --git a/scripts/pm/fleet-roster.mjs b/scripts/pm/fleet-roster.mjs index 694f18bff4d..a0ae4811d4c 100644 --- a/scripts/pm/fleet-roster.mjs +++ b/scripts/pm/fleet-roster.mjs @@ -46,9 +46,10 @@ * project 「由 X 账户的项目负责」 in the title or body — the line * a project-held seat carries. * in flight open `pm:dispatched` cards of the lane assigned to the - * seat's account. A `domain:x` lane is that label on the - * seat's repo; a `repo:x` lane is every card of repo x plus - * the post's own repo's cards labelled `repo:x`. An account + * seat's account. A `repo:x` lane is every card of repo x + * plus the post's own repo's cards labelled `repo:x`; a + * `domain:x` row (a retired domain seat) owns no card — a + * card's `domain:*` label no longer decides who holds it. An account * on two seats of one lane shows them on its lowest seat * only; the other reads `= seat N`. An `l2-review` seat (old spelling `review`) * (`lanes/l2-review.md`) holds no card: its in-flight is the @@ -390,8 +391,11 @@ export function unassignedMailboxes(snapshot, rows) { .map((m) => ({ ...m, why: m.slug === null ? 'legacy per-login, names no seat' : 'no seat post or epic parent carries this seat' })); } +// Which lane a card is on. A `repo:x` seat owns its repo's cards (and the post's own repo's cards labelled +// `repo:x`). ⛔ A `domain:x` seat row owns NO card: lanes are seats plus epics, the domain seats retired, and +// a card's `domain:*` label no longer decides who holds it — so the post still shows as a row, with empty +// card columns, until it is retitled or closed. const cardLaneMatch = (card, row) => { - if (row.lane.startsWith('domain:')) return card.repo === row.repo && card.labels.includes(row.lane); if (row.lane.startsWith('repo:')) return card.repo === row.repo || (card.repo === row.board && card.labels.includes(row.lane)); return false; }; @@ -728,7 +732,10 @@ const SELF_TEST_BATTERIES = Object.freeze({ 'seat titles: lane, seat, repo, status, account, project': 13, 'wall notes, closing refs, verdicts and mailboxes': 13, // 25 → 29: the L2 seat's row, its claim reading, the lane-word pin (lanes/l2-review.md, #29242). - 'the fixture snapshot: rows for the three repos': 29, + // 29 → 24: a `domain:` row owns no card any more — nine ownership cases become four that pin it owning nothing, + // and the positive ownership cases move, as five, to the repo-lane battery below. + 'the fixture snapshot: rows for the three repos': 24, + 'a repo-lane seat owns its repo\'s cards by account: in flight, landing, merge, ruling': 7, // 13 → 14: the lane-grammar pin (the signature alternation equals the opener's lane-word lists, `coordinator` aside). 'one account on two seats of a lane: the second seat reads its own traces': 14, 'the rendered body: marker, columns, footer, determinism': 11, @@ -736,7 +743,7 @@ const SELF_TEST_BATTERIES = Object.freeze({ 'the CLI: fixture runs offline, usage errors are exit 2': 6, 'paging: a three-page read through the loop equals the slurped array': 4, }); -const SELF_TEST_BATTERY_FLOOR = 9; +const SELF_TEST_BATTERY_FLOOR = 10; async function selfTest() { let failed = 0; @@ -843,29 +850,43 @@ async function selfTest() { t('isEpicParent is both halves of H45\'s delegation signals, over every fixture epic and a bare card', await (async () => { const { h45DelegationNodeSignals } = await import('./check-half-states.mjs'); return [...fixture.repos['objectstack-ai/objectstack'].epics, {}].map((i) => { const h = h45DelegationNodeSignals(i); return isEpicParent(i) === (h.subIssues && h.registration); }); })(), [true, true, true, true, true, true]); t('the non-seat issue in the seat list is skipped', rows.some((r) => r.post === 999), false); t('today’s three seats carry the right accounts', [row(19287).account, row(6023).account, row(1353, 'objectstack-ai/hotcrm').account], ['os-elon-musk', 'os-elon-musk', 'os-elon-musk']); - t('devx seat 1: its assigned dispatched card, not seat 2’s', row(6023).inFlight, [{ repo: 'objectstack-ai/objectstack', number: 25416 }]); - t('devx seat 2 (os-sales) has its own card', row(20163).inFlight, [{ repo: 'objectstack-ai/objectstack', number: 25300 }]); - t('a card of another lane never leaks in', row(19287).inFlight, [{ repo: 'objectstack-ai/objectstack', number: 25412 }]); - t('awaiting landing: the ACCEPTed claude/ PR only', row(19287).awaitingLanding, [{ repo: 'objectstack-ai/objectstack', number: 25427 }]); + t('⛔ a retired `domain:` seat row owns no card: its account\'s dispatched cards sit on no domain row, the label on them notwithstanding', [row(6023).inFlight, row(20163).inFlight, row(19287).inFlight], [[], [], []]); + t('⛔ …nor on a sibling board\'s `domain:` row', [row(5560, 'objectstack-ai/objectui').inFlight, row(10243, 'objectstack-ai/objectui').inFlight], [[], []]); + t('⛔ …so a domain row holds no landing, no merge and no ruling either', [row(19287).awaitingLanding, row(19287).awaitingMerge, row(6023).awaitingRuling, row(19287).awaitingRuling], [[], [], [], []]); + t('…while the post still shows as a row, its lane, status and account read off the title', [row(6023).lane, row(6023).status, row(6023).account], ['domain:devx', 'seated', 'os-elon-musk']); t('a pm:mailbox PR closing a card never counts as landing', row(6023).awaitingLanding, []); t('a PR with no verdict does not count', row(1353, 'objectstack-ai/hotcrm').awaitingLanding, []); - t('an unassigned ruling sits on the lane’s lowest seated seat', [row(6023).awaitingRuling, row(20163).awaitingRuling], [[{ repo: 'objectstack-ai/objectstack', number: 25373 }], []]); - t('a ruling assigned to seat 2’s account sits on seat 2', row(19287).awaitingRuling, [{ repo: 'objectstack-ai/objectstack', number: 25344 }]); - t('⭐ a pull carrying `pm:awaiting-merge` that closes an in-flight card sits on that card’s seat, in its own column — the PR half of the inbox', row(19287).awaitingMerge, [os(25427)]); t('⛔ a pull labelled `needs-user-decision` (the retired shape) is awaiting merge nowhere, and awaiting ruling never counts a pull', [rows.some((r) => r.awaitingMerge.length && r.post !== 19287), rows.some((r) => r.awaitingRuling.some((x) => x.number === 25401))], [false, false]); t('the two inbox halves are counted apart, every repo in, and never summed', inboxTotals(fixture), { decisionCards: 2, awaitingMergePulls: 1 }); t('⭐ the mailbox column is the SEAT\'s pm:mailbox PR — by body line on a --head branch, by head slug, by both', [row(6023).mailbox, row(19287).mailbox, row(20163).mailbox], [[os(25392)], [os(25393)], [os(25394)]]); t('⛔ one login on three seats: each seat shows only its own mailbox, and a seat that opened none shows none', [row(6023).mailbox.length, row(19287).mailbox.length, row(1353, 'objectstack-ai/hotcrm').mailbox], [1, 1, []]); t('⛔ a legacy per-login mailbox and a seat no post or open epic parent carries sit on no row — flagged, never attributed to the login\'s seats', [unassignedMailboxes(fixture, rows).map((m) => [m.ref.number, m.seat, m.login, m.why]), [row(5560, 'objectstack-ai/objectui').mailbox, row(10243, 'objectstack-ai/objectui').mailbox]], [[[25395, null, 'os-sales', 'legacy per-login, names no seat'], [25396, 'domain:spec#5', 'os-tesla', 'no seat post or epic parent carries this seat'], [25398, 'epic:#28130#1', 'os-zhuang', 'no seat post or epic parent carries this seat']], [[], []]]); t('stale and no wall note ⇒ 疑似撞墙; a wall note silences it; vacant never', [row(20163).suspectedWall, row(5560, 'objectstack-ai/objectui').suspectedWall, row(5560, 'objectstack-ai/objectui').wallNote, row(7623).suspectedWall], [true, false, 'limit reached, resets at 15:00Z', false]); - t('last activity is the newest of post and in-flight cards', row(6023).lastActivity, '2026-10-23T13:28:00Z'); const rv = (({ lane, seat, status, account, sharesWith, inFlight, awaitingLanding, awaitingRuling, mailbox, lastActivity, suspectedWall }) => ({ lane, seat, status, account, sharesWith, inFlight, awaitingLanding, awaitingRuling, mailbox, lastActivity, suspectedWall }))(row(25500)); t('⭐ an L2 seat under the OLD lane word is still a row: lane `review`, seated by its login, never sharing; in flight = the open pulls whose current head its live Contract-review-claim holds, its mailbox in its column, and its last activity the claim comment', rv, { lane: 'review', seat: 1, status: 'seated', account: 'os-zhuang', sharesWith: null, inFlight: [os(25433)], awaitingLanding: [], awaitingRuling: [], mailbox: [os(25434)], lastActivity: '2026-10-23T13:30:00Z', suspectedWall: false }); t('⛔ of the fixture\'s three review-signed claims only the live one on the current head counts: the expired one (2 h) and the one on a moved head hold nothing', [fixture.repos['objectstack-ai/objectstack'].recentComments.filter((c) => /^review#/.test(c.body)).length, [...reviewClaims(fixture, { now: fixture.now }).entries()].map(([k, v]) => `${k}=${v.map((r) => r.number)}`)], [3, ['review#1=25433']]); t('⛔ a claim signed by a lane seat, or by nobody, is no review in-flight; an L2 seat holds no dispatched card of the lanes', [reviewClaims({ repos: { r: { pulls: [{ number: 1, state: 'open', head: { sha: 'a'.repeat(40) } }], recentComments: [{ issue_url: 'x/issues/1', created_at: fixture.now, body: `domain:ui#1 · a · session_01Abcdef\n\nContract-review-claim: session_01Abcdef · head ${'a'.repeat(40)} · ${fixture.now}` }, { issue_url: 'x/issues/1', created_at: fixture.now, body: `Contract-review-claim: session_01Abcdef · head ${'a'.repeat(40)} · ${fixture.now}` }] } } }, { now: fixture.now }).size, rows.filter((r) => isL2ReviewLane(r.lane) && r.inFlight.some((p) => fixture.repos['objectstack-ai/objectstack'].dispatched.some((d) => d.number === p.number))).length], [0, 0]); t('the L2 lane words are the opener\'s — imported, not a third spelling — and both are bare lanes', [mailboxOpen.L2_REVIEW_LANE_WORDS.every((w) => mailboxOpen.SEAT_BARE_LANES.includes(w)), mailboxOpen.L2_REVIEW_LANE_WORDS.map(isL2ReviewLane), isL2ReviewLane('triage')], [true, [true, true], false]); t('⭐ a NEW L2 seat reads under its own word: the title `l2-review · seat 2` parses to lane `l2-review` seat 2 (never lane `l`), and a live claim signed `l2-review#2` is that seat\'s in-flight — keyed by the word it signed, beside a `review#1` claim on another pull', (() => { const s = seat('[PM seat] l2-review · seat 2 — 🟢 os-tesla'); const head = 'b'.repeat(40); const claim = (sig) => ({ created_at: fixture.now, body: `${sig} · os-tesla · session_01Abcdef\n\nContract-review-claim: session_01Abcdef · head ${head} · ${fixture.now}` }); const held = reviewClaims({ repos: { r: { pulls: [{ number: 1, state: 'open', head: { sha: head } }, { number: 2, state: 'open', head: { sha: head } }], recentComments: [{ issue_url: 'x/issues/1', ...claim('l2-review#2') }, { issue_url: 'x/issues/2', ...claim('review#1') }] } } }, { now: fixture.now }); return [s.lane, s.seat, s.status, s.account, [...held.entries()].map(([k, v]) => `${k}=${v.map((p) => p.number)}`).sort()]; })(), ['l2-review', 2, 'seated', 'os-tesla', ['l2-review#2=1', 'review#1=2']]); - t('one account on two seats of a lane: cards on the lowest seat, the other reads = seat 1', [row(5560, 'objectstack-ai/objectui').inFlight.length, row(10243, 'objectstack-ai/objectui').sharesWith, row(10243, 'objectstack-ai/objectui').inFlight, row(10243, 'objectstack-ai/objectui').suspectedWall], [1, 1, [], true]); + + battery('a repo-lane seat owns its repo\'s cards by account: in flight, landing, merge, ruling'); + { + // The fixture with its four objectstack domain seat posts retitled to the repo lane, the shape every live seat + // post carries since lanes became seats plus epics. Same cards, same pulls: what moves is who holds them. + const RETITLE = { 6023: '[PM seat] repo:objectstack — 🟢 os-elon-musk · 由 os-elon-musk 账户的项目负责 · area:build', 20163: '[PM seat] repo:objectstack · seat 2 — 🟢 os-sales · area:fleet', 7623: '[PM seat] repo:objectstack · seat 3 — ⏳ vacant', 19287: '[PM seat] repo:objectstack · seat 4 — 🟢 os-elon-musk · area:ai' }; + const OS = 'objectstack-ai/objectstack'; + const retitled = JSON.parse(JSON.stringify(fixture)); + retitled.repos[OS].seats = retitled.repos[OS].seats.map((p) => (RETITLE[p.number] ? { ...p, title: RETITLE[p.number] } : p)); + const rrows = buildRows(retitled, { now: retitled.now }); + const rr = (post) => rrows.find((r) => r.post === post && r.board === OS); + t('⭐ in flight: each seat\'s account\'s dispatched cards on its repo, a `domain:*` label on the card read by nobody', [rr(6023).inFlight.map((c) => c.number), rr(20163).inFlight.map((c) => c.number)], [[25412, 25416, 25500], [25300]]); + t('one account on two seats of a lane: cards on the lowest seat, the other reads = seat 1', [rr(19287).sharesWith, rr(19287).inFlight], [1, []]); + t('awaiting landing: the ACCEPTed claude/ PR only — a pm:mailbox PR closing a card never counts', rr(6023).awaitingLanding, [os(25427)]); + t('⭐ a pull carrying `pm:awaiting-merge` that closes an in-flight card sits on that card\'s seat, in its own column — the PR half of the inbox', rr(6023).awaitingMerge, [os(25427)]); + t('a ruling sits on the seat its assignee holds, else the lane\'s lowest seated seat', [rr(6023).awaitingRuling.map((c) => c.number), rr(20163).awaitingRuling], [[25344, 25373], []]); + t('last activity is the newest of post and in-flight cards', [rr(6023).lastActivity, rr(20163).lastActivity], ['2026-10-23T13:59:00Z', '2026-10-23T02:00:00Z']); + t('⛔ a vacant repo-lane seat holds nothing', [rr(7623).inFlight, rr(7623).awaitingRuling, rr(7623).suspectedWall], [[], [], false]); + } battery('one account on two seats of a lane: the second seat reads its own traces'); { @@ -878,14 +899,14 @@ async function selfTest() { repos: { [R]: { seats: [ - { number: 100, title: '[PM seat] domain:server — 🟢 os-pm', body: '', labels: ['pm:seat'], assignees: ['os-pm'], updated_at: '2026-10-30T00:00:00Z' }, - { number: 200, title: '[PM seat] domain:server · seat 2 — 🟢 os-pm', body: '', labels: ['pm:seat'], assignees: ['os-pm'], updated_at: '2026-10-31T00:00:00Z' }, + { number: 100, title: '[PM seat] repo:objectstack — 🟢 os-pm', body: '', labels: ['pm:seat'], assignees: ['os-pm'], updated_at: '2026-10-30T00:00:00Z' }, + { number: 200, title: '[PM seat] repo:objectstack · seat 2 — 🟢 os-pm', body: '', labels: ['pm:seat'], assignees: ['os-pm'], updated_at: '2026-10-31T00:00:00Z' }, ], - dispatched: [{ number: 300, labels: ['pm:dispatched', 'domain:server'], assignees: ['os-pm'], updated_at: fresh }], + dispatched: [{ number: 300, labels: ['pm:dispatched'], assignees: ['os-pm'], updated_at: fresh }], rulings: [], pulls: [ - ...(seat1MailboxAt ? [{ number: 401, state: 'open', head: { ref: 'mailbox/os-pm/server-1' }, body: 'Mailbox-of: domain:server#1 · os-pm', labels: ['pm:mailbox'], updated_at: seat1MailboxAt }] : []), - ...(mailboxAt ? [{ number: 402, state: 'open', head: { ref: 'mailbox/os-pm/server-2' }, body: 'Mailbox-of: domain:server#2 · os-pm', labels: ['pm:mailbox'], updated_at: mailboxAt }] : []), + ...(seat1MailboxAt ? [{ number: 401, state: 'open', head: { ref: 'mailbox/os-pm/repo-objectstack-1' }, body: 'Mailbox-of: repo:objectstack#1 · os-pm', labels: ['pm:mailbox'], updated_at: seat1MailboxAt }] : []), + ...(mailboxAt ? [{ number: 402, state: 'open', head: { ref: 'mailbox/os-pm/repo-objectstack-2' }, body: 'Mailbox-of: repo:objectstack#2 · os-pm', labels: ['pm:mailbox'], updated_at: mailboxAt }] : []), ], comments: {}, recentComments: comments, @@ -895,13 +916,13 @@ async function selfTest() { const seat2 = (s) => (({ sharesWith, inFlight, mailbox, lastActivity, suspectedWall }) => ({ sharesWith, inFlight, mailbox, lastActivity, suspectedWall }))(buildRows(s, { now: NOW }).find((r) => r.post === 200)); t('no trace of its own: seat 2 reads = seat 1, its post alone, and is flagged', seat2(snap()), { sharesWith: 1, inFlight: [], mailbox: [], lastActivity: '2026-10-31T00:00:00Z', suspectedWall: true }); t('⭐ a fresh mailbox pull lifts the flag, and the in-flight cell still reads = seat 1', seat2(snap({ mailboxAt: fresh })), { sharesWith: 1, inFlight: [], mailbox: [{ repo: R, number: 402 }], lastActivity: fresh, suspectedWall: false }); - t('⭐ a fresh comment signed domain:server#2 lifts the flag', seat2(snap({ comments: [{ body: `${sig('domain:server#2')}\n\n## 席位核对 — ACCEPT`, updated_at: fresh }] })), { sharesWith: 1, inFlight: [], mailbox: [], lastActivity: fresh, suspectedWall: false }); - t('⛔ mailbox and signed comment both older than STALE_HOURS: flagged, last activity the newer of them', seat2(snap({ mailboxAt: stale, comments: [{ body: sig('domain:server#2'), updated_at: '2026-11-01T19:00:00Z' }] })), { sharesWith: 1, inFlight: [], mailbox: [{ repo: R, number: 402 }], lastActivity: stale, suspectedWall: true }); - t('⛔ by seat, never by account: seat 1\'s fresh signed comment and fresh mailbox, same account, leave seat 2 flagged', seat2(snap({ seat1MailboxAt: fresh, comments: [{ body: sig('domain:server#1'), updated_at: fresh }] })).suspectedWall, true); + t('⭐ a fresh comment signed repo:objectstack#2 lifts the flag', seat2(snap({ comments: [{ body: `${sig('repo:objectstack#2')}\n\n## 席位核对 — ACCEPT`, updated_at: fresh }] })), { sharesWith: 1, inFlight: [], mailbox: [], lastActivity: fresh, suspectedWall: false }); + t('⛔ mailbox and signed comment both older than STALE_HOURS: flagged, last activity the newer of them', seat2(snap({ mailboxAt: stale, comments: [{ body: sig('repo:objectstack#2'), updated_at: '2026-11-01T19:00:00Z' }] })), { sharesWith: 1, inFlight: [], mailbox: [{ repo: R, number: 402 }], lastActivity: stale, suspectedWall: true }); + t('⛔ by seat, never by account: seat 1\'s fresh signed comment and fresh mailbox, same account, leave seat 2 flagged', seat2(snap({ seat1MailboxAt: fresh, comments: [{ body: sig('repo:objectstack#1'), updated_at: fresh }] })).suspectedWall, true); t('⛔ another lane\'s seat 2, or a seat-2 signature on a repo: lane, is not this seat', seat2(snap({ comments: [{ body: sig('domain:ui#2'), updated_at: fresh }, { body: sig('repo:server#2'), updated_at: fresh }] })).suspectedWall, true); - t('⛔ a signature that is not the FIRST non-empty line, or is spelled wrong, signs nothing', seat2(snap({ comments: [{ body: `Claim: x\n${sig('domain:server#2')}`, updated_at: fresh }, { body: 'domain:server#2 - os-pm - session_01SharedSeatSess', updated_at: fresh }, { body: 'domain:server#2 · os-pm · session_01x', updated_at: fresh }] })).suspectedWall, true); - t('the newest of the four traces wins, and the comment\'s updated_at is its time', seat2(snap({ mailboxAt: '2026-11-02T01:00:00Z', comments: [{ body: sig('domain:server#2'), created_at: '2026-11-02T00:00:00Z', updated_at: '2026-11-02T03:30:00Z' }, { body: sig('domain:server#2'), updated_at: '2026-11-02T02:00:00Z' }] })).lastActivity, '2026-11-02T03:30:00Z'); - t('seat 1 keeps its cards and reads its own traces too', (({ inFlight, lastActivity, suspectedWall }) => ({ inFlight, lastActivity, suspectedWall }))(buildRows(snap({ comments: [{ body: sig('domain:server#1'), updated_at: '2026-11-02T03:45:00Z' }] }), { now: NOW }).find((r) => r.post === 100)), { inFlight: [{ repo: R, number: 300 }], lastActivity: '2026-11-02T03:45:00Z', suspectedWall: false }); + t('⛔ a signature that is not the FIRST non-empty line, or is spelled wrong, signs nothing', seat2(snap({ comments: [{ body: `Claim: x\n${sig('repo:objectstack#2')}`, updated_at: fresh }, { body: 'repo:objectstack#2 - os-pm - session_01SharedSeatSess', updated_at: fresh }, { body: 'repo:objectstack#2 · os-pm · session_01x', updated_at: fresh }] })).suspectedWall, true); + t('the newest of the four traces wins, and the comment\'s updated_at is its time', seat2(snap({ mailboxAt: '2026-11-02T01:00:00Z', comments: [{ body: sig('repo:objectstack#2'), created_at: '2026-11-02T00:00:00Z', updated_at: '2026-11-02T03:30:00Z' }, { body: sig('repo:objectstack#2'), updated_at: '2026-11-02T02:00:00Z' }] })).lastActivity, '2026-11-02T03:30:00Z'); + t('seat 1 keeps its cards and reads its own traces too', (({ inFlight, lastActivity, suspectedWall }) => ({ inFlight, lastActivity, suspectedWall }))(buildRows(snap({ comments: [{ body: sig('repo:objectstack#1'), updated_at: '2026-11-02T03:45:00Z' }] }), { now: NOW }).find((r) => r.post === 100)), { inFlight: [{ repo: R, number: 300 }], lastActivity: '2026-11-02T03:45:00Z', suspectedWall: false }); t('the rendered row keeps = seat 1 and drops the flag once a trace is fresh', (() => { const line = renderBody(buildRows(snap({ mailboxAt: fresh }), { now: NOW }), { now: NOW, repos: [R] }).split('\n').find((l) => l.includes('/issues/200)')); return [line.includes('| = seat 1 |'), line.includes(SUSPECTED_WALL)];