fix(pm): scope pm:* label queries to open cards, re-judge the closed-residue census - #13752

Merged
huangyiirene merged 2 commits into
mainfrom
claude/issue-13605-pm-state-open-audit
Aug 31, 2026
Merged

fix(pm): scope pm:* label queries to open cards, re-judge the closed-residue census#13752
huangyiirene merged 2 commits into
mainfrom
claude/issue-13605-pm-state-open-audit

Conversation

@huangyiirene

@huangyiirenehuangyiirene commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Fixes#13605

Reader-side audit of every pm:*-label issue query, plus the census-leg re-judgment,
under the maintainer ruling of 2026-08-31 (第 6 场总监席决裁批 #13), verbatim and
untranslated:

「13605 已关卡 为什么要清理。普查时不应该只看open的卡片吗,其他同意」

No bulk strip, no backfill, no reaper. The ~3,000 closed cards carrying pm:* stay as
they are; what makes them harmless is that every reader selecting by a pm:* label
scopes itself to open cards.

Item ① — the reader audit

Population: call sites in scripts/pm/**, and the patrol paths those scripts drive,
that query issues by pm:* labels. Enumerated by reading every API call site in the
tree, not by sampling.

Result: 2 sites in population. Both were already open-scoped or deliberately closed-scoped —
zero sites were missing an open-state filter.
The audit's value is therefore a pin, not a
repair: the scoping that the whole ruling rests on was an incidental detail of one inline
template, and nothing would have gone red if a later edit had widened it.

sitequeries pm:* howopen filter beforeverdict / fix
listIssues()check-half-states.mjsGET /issues with state=open plus labels=LABEL, one page-loop per state label (7 labels)state=openpresentcompliant — extracted to pmLabelListingPath(), now the single place the scoping is asserted, with the ruling cited in its docblock and 11 self-test pins behind it
censusClosedPmResidue()check-half-states.mjsGET /issues with state=closed plus labels=LABEL, fully paginated, one pass per residue labelstate=closedby designre-judged — see item ②

Out of population — measured, not assumed

Closed-card readers that do not select by a pm:* label (they read residue locally
from rows fetched for another reason):

sitewhy it is out
listRecentlyClosedIssues() (drives H22)no label filter; a 3-day closure window, residue read from the returned rows
census control queryGET /issues with state=closed, deliberately unfiltered — it is the instrument control

Issue/PR queries that never touch a pm:* label: listAllOpenIssues() (already
open-scoped), listOpenPrs(), listRecentlyMergedPrs(), the per-card comment fetch, PR
detail, PR files, the Blocked-by: target read, the repo probe, the commit window and the
issue-event window — all by number or unfiltered.

Scripts that query no issues at all by pm:* label, so they are out of population
entirely — this is the "measure, don't assume" half the dispatch asked for:

  • ci-failure.mjs — check-runs, annotations, action runs/jobs, one PR by number.
  • check-governed-merges.mjs — one PR by number.
  • check-governed-queue-guard.mjs — one PR's reviews and head.
  • check-label-desc-cap.mjs — its two pm: strings are self-test fixture text inside a
    gh label create line; it makes no API call.
  • dispatch-gates.mjs — no API calls; its only pm: grep hit is pnpm: inside a
    variable name, not a label.
  • ensure-pm-labels.sh — creates and reconciles label objects; never queries issues.
  • bare-root-worklist.mjs, check-dispatch-gates.mjs, check-governed-prose.mjs,
    check-skill-id-lint.mjs, check-skill-line-ratchet.mjs, git-history.mjs,
    release-rehearsal-clone.mjs, os-verify-lock.sh, os-regen-merge.sh — no API calls.
  • .github/workflows/half-state-patrol.yml, the only patrol path these scripts drive —
    its sole API write is an anchor-issue update; it runs no label query.

Item ② — the census leg, re-judged

renderClosedResidueCensus went from a block (bold heading, a row per label, a nested row
per lane, a page-cap alarm, a control-failure alarm, a contradictory-pair roster, and two
closing warnings) to one informational line, italic in markdown — the styling the
healthy rate premise already uses, deliberately not the bold heading a finding block wears.

Closed-card `pm:*` residue (H39 census, informational): pm:dispatched 2064, pm:queue 846,
pm:blocking 27, pm:blocked 18, pm:on-hold 13, pm:awaiting-maintainer 2, oldest closed
2026-08-02; 555 carrying both `pm:queue` and `pm:dispatched`. Archive, not state — no
cleanup is owed and none is planned (ruled 2026-08-31, 批 #13); readers scope `pm:*`
queries to open cards.

What was kept and why:

  • The gathering is unchanged. The figures are the informational line's content, and the
    cost lands on the patrol workflow's own runner token (15,000/h core), not on the shared
    agent pool the 2026-08-16 ruling protects.
  • The #4690 instrument caveats survive, demoted to a parenthesis. A page cap is still
    not a count and an empty control still means "not read" — that is about the instrument,
    and the ruling was about the board. censusIsCountable is untouched. The two caveats
    are now mutually exclusive on the line, and a pin refuses the naive fallback that would
    let a capped census also blame the control.
  • One bug found while collapsing it: the old "oldest closed" reading took a bare find
    over rows — the first row carrying an oldest — and rows is sorted by size, so it
    reported the oldest closure of the largest label while reading as the population's
    floor. Now a global minimum, with a pin whose fixture puts the real floor on the smaller
    label.

Why H22 was left alone — stated because it is the one judgment call here

H22 also reports pm:* residue on closed cards, and as finding rows. It is deliberately
not changed, and the PM should confirm this reading:

  • Item ② of the ruling names one leg: the census leg (H39). H22 predates it and is a
    different shape.
  • Item ③ keeps close-time hygiene as the convention. H22, bounded to a 3-day closure
    window, is the only mechanism that observes that convention; deleting it would silently
    retire a rule the ruling explicitly retained.
  • H22 never asks for the backlog cleanup that was refused — its window covers residue
    produced now, while the paired write is still a live duty someone remembers.

If the PM reads 「普查时不应该只看open的卡片吗」 as reaching H22 too, that is a one-line
change to h22ClosedCardPmResidue and belongs on its own card rather than smuggled in here.

Verification

Authored by Claude Code session session_01EnE7G31tqbxN1rqpQmzurT (durable attribution
copy — a body edit rewrites the footer below).

  • node scripts/pm/check-half-states.mjs --self-testbefore:
    ✓ check-half-states self-test: 1791 cases pass. (exit 0). After:
    ✓ check-half-states self-test: 1826 cases pass. (exit 0). 35 new pins.
  • Reverse verification, three ablations, each committed first, each confirmed on disk by
    counting the injected and the original spelling, each restored and the restore proved by
    git hash-object equality against the HEAD blob:
    • the open-state scoping widened to all states in pmLabelListingPath8 pins red, exit 1.
    • an alarm glyph injected into the census line — 2 pins red, exit 1.
    • global-oldest reverted to the bare find2 pins red, exit 1.
  • Gate families derived from the real diff via node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (exit 0; it reads the merge-base change set itself). 17 derived
    plus 2 convention-triggered for a gate-script edit. 16 green; three are not readings and
    say so themselves: check-partof-closing-keyword exits 2 NOT WIRED without a PR body in the
    environment (its pnpm check:partof-closing-keyword spelling is green, and this body was
    checked against it separately), check-test-completeness exits 3 and instructs the local
    family runner to record NOT MEASURED, and the livecheck-half-states sweep exits 3
    PREREQUISITE NOT MET because this container's session gate refuses repo-scoped reads.
  • pnpm lint (repo-wide eslint . --no-inline-config, no narrowing) — exit 0, 103s.
  • node scripts/check-nul-bytes.mjs — OK, 7,574 text files, no raw control bytes.
  • Union re-run on the final commit 54f5b104 — the gate families above, pnpm lint and the
    self-test all ran on that tree, which is this PR head.

No changeset: the diff is scripts/pm/** only, which publishes from no package — the
skip-changeset closed list. The label is applied on this PR.

Refs: #13526 and PR #13601 (the census leg being re-judged) · #13597.

Generated by Claude Code

…residue census
Reader-side audit ruled by the maintainer on 2026-08-31 (第 6 场总监席决裁批 #13):
closed cards carrying pm:* state are archive, not state. No bulk strip, no
backfill, no reaper — the residue is made harmless by open-scoped readers.
- Extract `pmLabelListingPath`, the one place `state=open` is asserted on a
pm:*-label listing, and pin it (every residue label, encoding, page).
- Collapse the H39 census render from a per-lane table with page-cap and
control alarms to ONE informational line, italic in markdown, no alarm
glyphs, no finding row. Instrument caveats (#4690) survive as a qualifier.
- Re-judge the H39 self-test pins that pinned the removed render branches.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EnE7G31tqbxN1rqpQmzurT
…st label's
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EnE7G31tqbxN1rqpQmzurT
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

2 participants

@huangyiirene@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

fix(pm): scope pm:* label queries to open cards, re-judge the closed-residue census - #13752

Merged
huangyiirene merged 2 commits into
mainfrom
claude/issue-13605-pm-state-open-audit
Aug 31, 2026
Merged

fix(pm): scope pm:* label queries to open cards, re-judge the closed-residue census#13752
huangyiirene merged 2 commits into
mainfrom
claude/issue-13605-pm-state-open-audit

Conversation

@huangyiirene

@huangyiirenehuangyiirene commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Fixes#13605

Reader-side audit of every pm:*-label issue query, plus the census-leg re-judgment,
under the maintainer ruling of 2026-08-31 (第 6 场总监席决裁批 #13), verbatim and
untranslated:

「13605 已关卡 为什么要清理。普查时不应该只看open的卡片吗,其他同意」

No bulk strip, no backfill, no reaper. The ~3,000 closed cards carrying pm:* stay as
they are; what makes them harmless is that every reader selecting by a pm:* label
scopes itself to open cards.

Item ① — the reader audit

Population: call sites in scripts/pm/**, and the patrol paths those scripts drive,
that query issues by pm:* labels. Enumerated by reading every API call site in the
tree, not by sampling.

Result: 2 sites in population. Both were already open-scoped or deliberately closed-scoped —
zero sites were missing an open-state filter.
The audit's value is therefore a pin, not a
repair: the scoping that the whole ruling rests on was an incidental detail of one inline
template, and nothing would have gone red if a later edit had widened it.

sitequeries pm:* howopen filter beforeverdict / fix
listIssues()check-half-states.mjsGET /issues with state=open plus labels=LABEL, one page-loop per state label (7 labels)state=openpresentcompliant — extracted to pmLabelListingPath(), now the single place the scoping is asserted, with the ruling cited in its docblock and 11 self-test pins behind it
censusClosedPmResidue()check-half-states.mjsGET /issues with state=closed plus labels=LABEL, fully paginated, one pass per residue labelstate=closedby designre-judged — see item ②

Out of population — measured, not assumed

Closed-card readers that do not select by a pm:* label (they read residue locally
from rows fetched for another reason):

sitewhy it is out
listRecentlyClosedIssues() (drives H22)no label filter; a 3-day closure window, residue read from the returned rows
census control queryGET /issues with state=closed, deliberately unfiltered — it is the instrument control

Issue/PR queries that never touch a pm:* label: listAllOpenIssues() (already
open-scoped), listOpenPrs(), listRecentlyMergedPrs(), the per-card comment fetch, PR
detail, PR files, the Blocked-by: target read, the repo probe, the commit window and the
issue-event window — all by number or unfiltered.

Scripts that query no issues at all by pm:* label, so they are out of population
entirely — this is the "measure, don't assume" half the dispatch asked for:

  • ci-failure.mjs — check-runs, annotations, action runs/jobs, one PR by number.
  • check-governed-merges.mjs — one PR by number.
  • check-governed-queue-guard.mjs — one PR's reviews and head.
  • check-label-desc-cap.mjs — its two pm: strings are self-test fixture text inside a
    gh label create line; it makes no API call.
  • dispatch-gates.mjs — no API calls; its only pm: grep hit is pnpm: inside a
    variable name, not a label.
  • ensure-pm-labels.sh — creates and reconciles label objects; never queries issues.
  • bare-root-worklist.mjs, check-dispatch-gates.mjs, check-governed-prose.mjs,
    check-skill-id-lint.mjs, check-skill-line-ratchet.mjs, git-history.mjs,
    release-rehearsal-clone.mjs, os-verify-lock.sh, os-regen-merge.sh — no API calls.
  • .github/workflows/half-state-patrol.yml, the only patrol path these scripts drive —
    its sole API write is an anchor-issue update; it runs no label query.

Item ② — the census leg, re-judged

renderClosedResidueCensus went from a block (bold heading, a row per label, a nested row
per lane, a page-cap alarm, a control-failure alarm, a contradictory-pair roster, and two
closing warnings) to one informational line, italic in markdown — the styling the
healthy rate premise already uses, deliberately not the bold heading a finding block wears.

Closed-card `pm:*` residue (H39 census, informational): pm:dispatched 2064, pm:queue 846,
pm:blocking 27, pm:blocked 18, pm:on-hold 13, pm:awaiting-maintainer 2, oldest closed
2026-08-02; 555 carrying both `pm:queue` and `pm:dispatched`. Archive, not state — no
cleanup is owed and none is planned (ruled 2026-08-31, 批 #13); readers scope `pm:*`
queries to open cards.

What was kept and why:

  • The gathering is unchanged. The figures are the informational line's content, and the
    cost lands on the patrol workflow's own runner token (15,000/h core), not on the shared
    agent pool the 2026-08-16 ruling protects.
  • The #4690 instrument caveats survive, demoted to a parenthesis. A page cap is still
    not a count and an empty control still means "not read" — that is about the instrument,
    and the ruling was about the board. censusIsCountable is untouched. The two caveats
    are now mutually exclusive on the line, and a pin refuses the naive fallback that would
    let a capped census also blame the control.
  • One bug found while collapsing it: the old "oldest closed" reading took a bare find
    over rows — the first row carrying an oldest — and rows is sorted by size, so it
    reported the oldest closure of the largest label while reading as the population's
    floor. Now a global minimum, with a pin whose fixture puts the real floor on the smaller
    label.

Why H22 was left alone — stated because it is the one judgment call here

H22 also reports pm:* residue on closed cards, and as finding rows. It is deliberately
not changed, and the PM should confirm this reading:

  • Item ② of the ruling names one leg: the census leg (H39). H22 predates it and is a
    different shape.
  • Item ③ keeps close-time hygiene as the convention. H22, bounded to a 3-day closure
    window, is the only mechanism that observes that convention; deleting it would silently
    retire a rule the ruling explicitly retained.
  • H22 never asks for the backlog cleanup that was refused — its window covers residue
    produced now, while the paired write is still a live duty someone remembers.

If the PM reads 「普查时不应该只看open的卡片吗」 as reaching H22 too, that is a one-line
change to h22ClosedCardPmResidue and belongs on its own card rather than smuggled in here.

Verification

Authored by Claude Code session session_01EnE7G31tqbxN1rqpQmzurT (durable attribution
copy — a body edit rewrites the footer below).

  • node scripts/pm/check-half-states.mjs --self-testbefore:
    ✓ check-half-states self-test: 1791 cases pass. (exit 0). After:
    ✓ check-half-states self-test: 1826 cases pass. (exit 0). 35 new pins.
  • Reverse verification, three ablations, each committed first, each confirmed on disk by
    counting the injected and the original spelling, each restored and the restore proved by
    git hash-object equality against the HEAD blob:
    • the open-state scoping widened to all states in pmLabelListingPath8 pins red, exit 1.
    • an alarm glyph injected into the census line — 2 pins red, exit 1.
    • global-oldest reverted to the bare find2 pins red, exit 1.
  • Gate families derived from the real diff via node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (exit 0; it reads the merge-base change set itself). 17 derived
    plus 2 convention-triggered for a gate-script edit. 16 green; three are not readings and
    say so themselves: check-partof-closing-keyword exits 2 NOT WIRED without a PR body in the
    environment (its pnpm check:partof-closing-keyword spelling is green, and this body was
    checked against it separately), check-test-completeness exits 3 and instructs the local
    family runner to record NOT MEASURED, and the livecheck-half-states sweep exits 3
    PREREQUISITE NOT MET because this container's session gate refuses repo-scoped reads.
  • pnpm lint (repo-wide eslint . --no-inline-config, no narrowing) — exit 0, 103s.
  • node scripts/check-nul-bytes.mjs — OK, 7,574 text files, no raw control bytes.
  • Union re-run on the final commit 54f5b104 — the gate families above, pnpm lint and the
    self-test all ran on that tree, which is this PR head.

No changeset: the diff is scripts/pm/** only, which publishes from no package — the
skip-changeset closed list. The label is applied on this PR.

Refs: #13526 and PR #13601 (the census leg being re-judged) · #13597.

Generated by Claude Code

…residue census
Reader-side audit ruled by the maintainer on 2026-08-31 (第 6 场总监席决裁批 #13):
closed cards carrying pm:* state are archive, not state. No bulk strip, no
backfill, no reaper — the residue is made harmless by open-scoped readers.
- Extract `pmLabelListingPath`, the one place `state=open` is asserted on a
pm:*-label listing, and pin it (every residue label, encoding, page).
- Collapse the H39 census render from a per-lane table with page-cap and
control alarms to ONE informational line, italic in markdown, no alarm
glyphs, no finding row. Instrument caveats (#4690) survive as a qualifier.
- Re-judge the H39 self-test pins that pinned the removed render branches.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EnE7G31tqbxN1rqpQmzurT
…st label's
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EnE7G31tqbxN1rqpQmzurT
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

2 participants

@huangyiirene@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(pm): scope pm:* label queries to open cards, re-judge the closed-residue census - #13752

Merged
huangyiirene merged 2 commits into
mainfrom
claude/issue-13605-pm-state-open-audit
Aug 31, 2026
Merged

fix(pm): scope pm:* label queries to open cards, re-judge the closed-residue census#13752
huangyiirene merged 2 commits into
mainfrom
claude/issue-13605-pm-state-open-audit

Conversation

@huangyiirene

@huangyiirenehuangyiirene commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Fixes#13605

Reader-side audit of every pm:*-label issue query, plus the census-leg re-judgment,
under the maintainer ruling of 2026-08-31 (第 6 场总监席决裁批 #13), verbatim and
untranslated:

「13605 已关卡 为什么要清理。普查时不应该只看open的卡片吗,其他同意」

No bulk strip, no backfill, no reaper. The ~3,000 closed cards carrying pm:* stay as
they are; what makes them harmless is that every reader selecting by a pm:* label
scopes itself to open cards.

Item ① — the reader audit

Population: call sites in scripts/pm/**, and the patrol paths those scripts drive,
that query issues by pm:* labels. Enumerated by reading every API call site in the
tree, not by sampling.

Result: 2 sites in population. Both were already open-scoped or deliberately closed-scoped —
zero sites were missing an open-state filter.
The audit's value is therefore a pin, not a
repair: the scoping that the whole ruling rests on was an incidental detail of one inline
template, and nothing would have gone red if a later edit had widened it.

sitequeries pm:* howopen filter beforeverdict / fix
listIssues()check-half-states.mjsGET /issues with state=open plus labels=LABEL, one page-loop per state label (7 labels)state=openpresentcompliant — extracted to pmLabelListingPath(), now the single place the scoping is asserted, with the ruling cited in its docblock and 11 self-test pins behind it
censusClosedPmResidue()check-half-states.mjsGET /issues with state=closed plus labels=LABEL, fully paginated, one pass per residue labelstate=closedby designre-judged — see item ②

Out of population — measured, not assumed

Closed-card readers that do not select by a pm:* label (they read residue locally
from rows fetched for another reason):

sitewhy it is out
listRecentlyClosedIssues() (drives H22)no label filter; a 3-day closure window, residue read from the returned rows
census control queryGET /issues with state=closed, deliberately unfiltered — it is the instrument control

Issue/PR queries that never touch a pm:* label: listAllOpenIssues() (already
open-scoped), listOpenPrs(), listRecentlyMergedPrs(), the per-card comment fetch, PR
detail, PR files, the Blocked-by: target read, the repo probe, the commit window and the
issue-event window — all by number or unfiltered.

Scripts that query no issues at all by pm:* label, so they are out of population
entirely — this is the "measure, don't assume" half the dispatch asked for:

  • ci-failure.mjs — check-runs, annotations, action runs/jobs, one PR by number.
  • check-governed-merges.mjs — one PR by number.
  • check-governed-queue-guard.mjs — one PR's reviews and head.
  • check-label-desc-cap.mjs — its two pm: strings are self-test fixture text inside a
    gh label create line; it makes no API call.
  • dispatch-gates.mjs — no API calls; its only pm: grep hit is pnpm: inside a
    variable name, not a label.
  • ensure-pm-labels.sh — creates and reconciles label objects; never queries issues.
  • bare-root-worklist.mjs, check-dispatch-gates.mjs, check-governed-prose.mjs,
    check-skill-id-lint.mjs, check-skill-line-ratchet.mjs, git-history.mjs,
    release-rehearsal-clone.mjs, os-verify-lock.sh, os-regen-merge.sh — no API calls.
  • .github/workflows/half-state-patrol.yml, the only patrol path these scripts drive —
    its sole API write is an anchor-issue update; it runs no label query.

Item ② — the census leg, re-judged

renderClosedResidueCensus went from a block (bold heading, a row per label, a nested row
per lane, a page-cap alarm, a control-failure alarm, a contradictory-pair roster, and two
closing warnings) to one informational line, italic in markdown — the styling the
healthy rate premise already uses, deliberately not the bold heading a finding block wears.

Closed-card `pm:*` residue (H39 census, informational): pm:dispatched 2064, pm:queue 846,
pm:blocking 27, pm:blocked 18, pm:on-hold 13, pm:awaiting-maintainer 2, oldest closed
2026-08-02; 555 carrying both `pm:queue` and `pm:dispatched`. Archive, not state — no
cleanup is owed and none is planned (ruled 2026-08-31, 批 #13); readers scope `pm:*`
queries to open cards.

What was kept and why:

  • The gathering is unchanged. The figures are the informational line's content, and the
    cost lands on the patrol workflow's own runner token (15,000/h core), not on the shared
    agent pool the 2026-08-16 ruling protects.
  • The #4690 instrument caveats survive, demoted to a parenthesis. A page cap is still
    not a count and an empty control still means "not read" — that is about the instrument,
    and the ruling was about the board. censusIsCountable is untouched. The two caveats
    are now mutually exclusive on the line, and a pin refuses the naive fallback that would
    let a capped census also blame the control.
  • One bug found while collapsing it: the old "oldest closed" reading took a bare find
    over rows — the first row carrying an oldest — and rows is sorted by size, so it
    reported the oldest closure of the largest label while reading as the population's
    floor. Now a global minimum, with a pin whose fixture puts the real floor on the smaller
    label.

Why H22 was left alone — stated because it is the one judgment call here

H22 also reports pm:* residue on closed cards, and as finding rows. It is deliberately
not changed, and the PM should confirm this reading:

  • Item ② of the ruling names one leg: the census leg (H39). H22 predates it and is a
    different shape.
  • Item ③ keeps close-time hygiene as the convention. H22, bounded to a 3-day closure
    window, is the only mechanism that observes that convention; deleting it would silently
    retire a rule the ruling explicitly retained.
  • H22 never asks for the backlog cleanup that was refused — its window covers residue
    produced now, while the paired write is still a live duty someone remembers.

If the PM reads 「普查时不应该只看open的卡片吗」 as reaching H22 too, that is a one-line
change to h22ClosedCardPmResidue and belongs on its own card rather than smuggled in here.

Verification

Authored by Claude Code session session_01EnE7G31tqbxN1rqpQmzurT (durable attribution
copy — a body edit rewrites the footer below).

  • node scripts/pm/check-half-states.mjs --self-testbefore:
    ✓ check-half-states self-test: 1791 cases pass. (exit 0). After:
    ✓ check-half-states self-test: 1826 cases pass. (exit 0). 35 new pins.
  • Reverse verification, three ablations, each committed first, each confirmed on disk by
    counting the injected and the original spelling, each restored and the restore proved by
    git hash-object equality against the HEAD blob:
    • the open-state scoping widened to all states in pmLabelListingPath8 pins red, exit 1.
    • an alarm glyph injected into the census line — 2 pins red, exit 1.
    • global-oldest reverted to the bare find2 pins red, exit 1.
  • Gate families derived from the real diff via node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (exit 0; it reads the merge-base change set itself). 17 derived
    plus 2 convention-triggered for a gate-script edit. 16 green; three are not readings and
    say so themselves: check-partof-closing-keyword exits 2 NOT WIRED without a PR body in the
    environment (its pnpm check:partof-closing-keyword spelling is green, and this body was
    checked against it separately), check-test-completeness exits 3 and instructs the local
    family runner to record NOT MEASURED, and the livecheck-half-states sweep exits 3
    PREREQUISITE NOT MET because this container's session gate refuses repo-scoped reads.
  • pnpm lint (repo-wide eslint . --no-inline-config, no narrowing) — exit 0, 103s.
  • node scripts/check-nul-bytes.mjs — OK, 7,574 text files, no raw control bytes.
  • Union re-run on the final commit 54f5b104 — the gate families above, pnpm lint and the
    self-test all ran on that tree, which is this PR head.

No changeset: the diff is scripts/pm/** only, which publishes from no package — the
skip-changeset closed list. The label is applied on this PR.

Refs: #13526 and PR #13601 (the census leg being re-judged) · #13597.

Generated by Claude Code

…residue census
Reader-side audit ruled by the maintainer on 2026-08-31 (第 6 场总监席决裁批 #13):
closed cards carrying pm:* state are archive, not state. No bulk strip, no
backfill, no reaper — the residue is made harmless by open-scoped readers.
- Extract `pmLabelListingPath`, the one place `state=open` is asserted on a
pm:*-label listing, and pin it (every residue label, encoding, page).
- Collapse the H39 census render from a per-lane table with page-cap and
control alarms to ONE informational line, italic in markdown, no alarm
glyphs, no finding row. Instrument caveats (#4690) survive as a qualifier.
- Re-judge the H39 self-test pins that pinned the removed render branches.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EnE7G31tqbxN1rqpQmzurT
…st label's
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EnE7G31tqbxN1rqpQmzurT
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

2 participants

@huangyiirene@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(pm): scope pm:* label queries to open cards, re-judge the closed-residue census - #13752

Merged
huangyiirene merged 2 commits into
mainfrom
claude/issue-13605-pm-state-open-audit
Aug 31, 2026
Merged

fix(pm): scope pm:* label queries to open cards, re-judge the closed-residue census#13752
huangyiirene merged 2 commits into
mainfrom
claude/issue-13605-pm-state-open-audit

Conversation

@huangyiirene

@huangyiirenehuangyiirene commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Fixes#13605

Reader-side audit of every pm:*-label issue query, plus the census-leg re-judgment,
under the maintainer ruling of 2026-08-31 (第 6 场总监席决裁批 #13), verbatim and
untranslated:

「13605 已关卡 为什么要清理。普查时不应该只看open的卡片吗,其他同意」

No bulk strip, no backfill, no reaper. The ~3,000 closed cards carrying pm:* stay as
they are; what makes them harmless is that every reader selecting by a pm:* label
scopes itself to open cards.

Item ① — the reader audit

Population: call sites in scripts/pm/**, and the patrol paths those scripts drive,
that query issues by pm:* labels. Enumerated by reading every API call site in the
tree, not by sampling.

Result: 2 sites in population. Both were already open-scoped or deliberately closed-scoped —
zero sites were missing an open-state filter.
The audit's value is therefore a pin, not a
repair: the scoping that the whole ruling rests on was an incidental detail of one inline
template, and nothing would have gone red if a later edit had widened it.

sitequeries pm:* howopen filter beforeverdict / fix
listIssues()check-half-states.mjsGET /issues with state=open plus labels=LABEL, one page-loop per state label (7 labels)state=openpresentcompliant — extracted to pmLabelListingPath(), now the single place the scoping is asserted, with the ruling cited in its docblock and 11 self-test pins behind it
censusClosedPmResidue()check-half-states.mjsGET /issues with state=closed plus labels=LABEL, fully paginated, one pass per residue labelstate=closedby designre-judged — see item ②

Out of population — measured, not assumed

Closed-card readers that do not select by a pm:* label (they read residue locally
from rows fetched for another reason):

sitewhy it is out
listRecentlyClosedIssues() (drives H22)no label filter; a 3-day closure window, residue read from the returned rows
census control queryGET /issues with state=closed, deliberately unfiltered — it is the instrument control

Issue/PR queries that never touch a pm:* label: listAllOpenIssues() (already
open-scoped), listOpenPrs(), listRecentlyMergedPrs(), the per-card comment fetch, PR
detail, PR files, the Blocked-by: target read, the repo probe, the commit window and the
issue-event window — all by number or unfiltered.

Scripts that query no issues at all by pm:* label, so they are out of population
entirely — this is the "measure, don't assume" half the dispatch asked for:

  • ci-failure.mjs — check-runs, annotations, action runs/jobs, one PR by number.
  • check-governed-merges.mjs — one PR by number.
  • check-governed-queue-guard.mjs — one PR's reviews and head.
  • check-label-desc-cap.mjs — its two pm: strings are self-test fixture text inside a
    gh label create line; it makes no API call.
  • dispatch-gates.mjs — no API calls; its only pm: grep hit is pnpm: inside a
    variable name, not a label.
  • ensure-pm-labels.sh — creates and reconciles label objects; never queries issues.
  • bare-root-worklist.mjs, check-dispatch-gates.mjs, check-governed-prose.mjs,
    check-skill-id-lint.mjs, check-skill-line-ratchet.mjs, git-history.mjs,
    release-rehearsal-clone.mjs, os-verify-lock.sh, os-regen-merge.sh — no API calls.
  • .github/workflows/half-state-patrol.yml, the only patrol path these scripts drive —
    its sole API write is an anchor-issue update; it runs no label query.

Item ② — the census leg, re-judged

renderClosedResidueCensus went from a block (bold heading, a row per label, a nested row
per lane, a page-cap alarm, a control-failure alarm, a contradictory-pair roster, and two
closing warnings) to one informational line, italic in markdown — the styling the
healthy rate premise already uses, deliberately not the bold heading a finding block wears.

Closed-card `pm:*` residue (H39 census, informational): pm:dispatched 2064, pm:queue 846,
pm:blocking 27, pm:blocked 18, pm:on-hold 13, pm:awaiting-maintainer 2, oldest closed
2026-08-02; 555 carrying both `pm:queue` and `pm:dispatched`. Archive, not state — no
cleanup is owed and none is planned (ruled 2026-08-31, 批 #13); readers scope `pm:*`
queries to open cards.

What was kept and why:

  • The gathering is unchanged. The figures are the informational line's content, and the
    cost lands on the patrol workflow's own runner token (15,000/h core), not on the shared
    agent pool the 2026-08-16 ruling protects.
  • The #4690 instrument caveats survive, demoted to a parenthesis. A page cap is still
    not a count and an empty control still means "not read" — that is about the instrument,
    and the ruling was about the board. censusIsCountable is untouched. The two caveats
    are now mutually exclusive on the line, and a pin refuses the naive fallback that would
    let a capped census also blame the control.
  • One bug found while collapsing it: the old "oldest closed" reading took a bare find
    over rows — the first row carrying an oldest — and rows is sorted by size, so it
    reported the oldest closure of the largest label while reading as the population's
    floor. Now a global minimum, with a pin whose fixture puts the real floor on the smaller
    label.

Why H22 was left alone — stated because it is the one judgment call here

H22 also reports pm:* residue on closed cards, and as finding rows. It is deliberately
not changed, and the PM should confirm this reading:

  • Item ② of the ruling names one leg: the census leg (H39). H22 predates it and is a
    different shape.
  • Item ③ keeps close-time hygiene as the convention. H22, bounded to a 3-day closure
    window, is the only mechanism that observes that convention; deleting it would silently
    retire a rule the ruling explicitly retained.
  • H22 never asks for the backlog cleanup that was refused — its window covers residue
    produced now, while the paired write is still a live duty someone remembers.

If the PM reads 「普查时不应该只看open的卡片吗」 as reaching H22 too, that is a one-line
change to h22ClosedCardPmResidue and belongs on its own card rather than smuggled in here.

Verification

Authored by Claude Code session session_01EnE7G31tqbxN1rqpQmzurT (durable attribution
copy — a body edit rewrites the footer below).

  • node scripts/pm/check-half-states.mjs --self-testbefore:
    ✓ check-half-states self-test: 1791 cases pass. (exit 0). After:
    ✓ check-half-states self-test: 1826 cases pass. (exit 0). 35 new pins.
  • Reverse verification, three ablations, each committed first, each confirmed on disk by
    counting the injected and the original spelling, each restored and the restore proved by
    git hash-object equality against the HEAD blob:
    • the open-state scoping widened to all states in pmLabelListingPath8 pins red, exit 1.
    • an alarm glyph injected into the census line — 2 pins red, exit 1.
    • global-oldest reverted to the bare find2 pins red, exit 1.
  • Gate families derived from the real diff via node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (exit 0; it reads the merge-base change set itself). 17 derived
    plus 2 convention-triggered for a gate-script edit. 16 green; three are not readings and
    say so themselves: check-partof-closing-keyword exits 2 NOT WIRED without a PR body in the
    environment (its pnpm check:partof-closing-keyword spelling is green, and this body was
    checked against it separately), check-test-completeness exits 3 and instructs the local
    family runner to record NOT MEASURED, and the livecheck-half-states sweep exits 3
    PREREQUISITE NOT MET because this container's session gate refuses repo-scoped reads.
  • pnpm lint (repo-wide eslint . --no-inline-config, no narrowing) — exit 0, 103s.
  • node scripts/check-nul-bytes.mjs — OK, 7,574 text files, no raw control bytes.
  • Union re-run on the final commit 54f5b104 — the gate families above, pnpm lint and the
    self-test all ran on that tree, which is this PR head.

No changeset: the diff is scripts/pm/** only, which publishes from no package — the
skip-changeset closed list. The label is applied on this PR.

Refs: #13526 and PR #13601 (the census leg being re-judged) · #13597.

Generated by Claude Code

…residue census
Reader-side audit ruled by the maintainer on 2026-08-31 (第 6 场总监席决裁批 #13):
closed cards carrying pm:* state are archive, not state. No bulk strip, no
backfill, no reaper — the residue is made harmless by open-scoped readers.
- Extract `pmLabelListingPath`, the one place `state=open` is asserted on a
pm:*-label listing, and pin it (every residue label, encoding, page).
- Collapse the H39 census render from a per-lane table with page-cap and
control alarms to ONE informational line, italic in markdown, no alarm
glyphs, no finding row. Instrument caveats (#4690) survive as a qualifier.
- Re-judge the H39 self-test pins that pinned the removed render branches.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EnE7G31tqbxN1rqpQmzurT
…st label's
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EnE7G31tqbxN1rqpQmzurT
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

2 participants

@huangyiirene@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

fix(pm): scope pm:* label queries to open cards, re-judge the closed-residue census - #13752

Merged
huangyiirene merged 2 commits into
mainfrom
claude/issue-13605-pm-state-open-audit
Aug 31, 2026
Merged

fix(pm): scope pm:* label queries to open cards, re-judge the closed-residue census#13752
huangyiirene merged 2 commits into
mainfrom
claude/issue-13605-pm-state-open-audit

Conversation

@huangyiirene

@huangyiirenehuangyiirene commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Fixes#13605

Reader-side audit of every pm:*-label issue query, plus the census-leg re-judgment,
under the maintainer ruling of 2026-08-31 (第 6 场总监席决裁批 #13), verbatim and
untranslated:

「13605 已关卡 为什么要清理。普查时不应该只看open的卡片吗,其他同意」

No bulk strip, no backfill, no reaper. The ~3,000 closed cards carrying pm:* stay as
they are; what makes them harmless is that every reader selecting by a pm:* label
scopes itself to open cards.

Item ① — the reader audit

Population: call sites in scripts/pm/**, and the patrol paths those scripts drive,
that query issues by pm:* labels. Enumerated by reading every API call site in the
tree, not by sampling.

Result: 2 sites in population. Both were already open-scoped or deliberately closed-scoped —
zero sites were missing an open-state filter.
The audit's value is therefore a pin, not a
repair: the scoping that the whole ruling rests on was an incidental detail of one inline
template, and nothing would have gone red if a later edit had widened it.

sitequeries pm:* howopen filter beforeverdict / fix
listIssues()check-half-states.mjsGET /issues with state=open plus labels=LABEL, one page-loop per state label (7 labels)state=openpresentcompliant — extracted to pmLabelListingPath(), now the single place the scoping is asserted, with the ruling cited in its docblock and 11 self-test pins behind it
censusClosedPmResidue()check-half-states.mjsGET /issues with state=closed plus labels=LABEL, fully paginated, one pass per residue labelstate=closedby designre-judged — see item ②

Out of population — measured, not assumed

Closed-card readers that do not select by a pm:* label (they read residue locally
from rows fetched for another reason):

sitewhy it is out
listRecentlyClosedIssues() (drives H22)no label filter; a 3-day closure window, residue read from the returned rows
census control queryGET /issues with state=closed, deliberately unfiltered — it is the instrument control

Issue/PR queries that never touch a pm:* label: listAllOpenIssues() (already
open-scoped), listOpenPrs(), listRecentlyMergedPrs(), the per-card comment fetch, PR
detail, PR files, the Blocked-by: target read, the repo probe, the commit window and the
issue-event window — all by number or unfiltered.

Scripts that query no issues at all by pm:* label, so they are out of population
entirely — this is the "measure, don't assume" half the dispatch asked for:

  • ci-failure.mjs — check-runs, annotations, action runs/jobs, one PR by number.
  • check-governed-merges.mjs — one PR by number.
  • check-governed-queue-guard.mjs — one PR's reviews and head.
  • check-label-desc-cap.mjs — its two pm: strings are self-test fixture text inside a
    gh label create line; it makes no API call.
  • dispatch-gates.mjs — no API calls; its only pm: grep hit is pnpm: inside a
    variable name, not a label.
  • ensure-pm-labels.sh — creates and reconciles label objects; never queries issues.
  • bare-root-worklist.mjs, check-dispatch-gates.mjs, check-governed-prose.mjs,
    check-skill-id-lint.mjs, check-skill-line-ratchet.mjs, git-history.mjs,
    release-rehearsal-clone.mjs, os-verify-lock.sh, os-regen-merge.sh — no API calls.
  • .github/workflows/half-state-patrol.yml, the only patrol path these scripts drive —
    its sole API write is an anchor-issue update; it runs no label query.

Item ② — the census leg, re-judged

renderClosedResidueCensus went from a block (bold heading, a row per label, a nested row
per lane, a page-cap alarm, a control-failure alarm, a contradictory-pair roster, and two
closing warnings) to one informational line, italic in markdown — the styling the
healthy rate premise already uses, deliberately not the bold heading a finding block wears.

Closed-card `pm:*` residue (H39 census, informational): pm:dispatched 2064, pm:queue 846,
pm:blocking 27, pm:blocked 18, pm:on-hold 13, pm:awaiting-maintainer 2, oldest closed
2026-08-02; 555 carrying both `pm:queue` and `pm:dispatched`. Archive, not state — no
cleanup is owed and none is planned (ruled 2026-08-31, 批 #13); readers scope `pm:*`
queries to open cards.

What was kept and why:

  • The gathering is unchanged. The figures are the informational line's content, and the
    cost lands on the patrol workflow's own runner token (15,000/h core), not on the shared
    agent pool the 2026-08-16 ruling protects.
  • The #4690 instrument caveats survive, demoted to a parenthesis. A page cap is still
    not a count and an empty control still means "not read" — that is about the instrument,
    and the ruling was about the board. censusIsCountable is untouched. The two caveats
    are now mutually exclusive on the line, and a pin refuses the naive fallback that would
    let a capped census also blame the control.
  • One bug found while collapsing it: the old "oldest closed" reading took a bare find
    over rows — the first row carrying an oldest — and rows is sorted by size, so it
    reported the oldest closure of the largest label while reading as the population's
    floor. Now a global minimum, with a pin whose fixture puts the real floor on the smaller
    label.

Why H22 was left alone — stated because it is the one judgment call here

H22 also reports pm:* residue on closed cards, and as finding rows. It is deliberately
not changed, and the PM should confirm this reading:

  • Item ② of the ruling names one leg: the census leg (H39). H22 predates it and is a
    different shape.
  • Item ③ keeps close-time hygiene as the convention. H22, bounded to a 3-day closure
    window, is the only mechanism that observes that convention; deleting it would silently
    retire a rule the ruling explicitly retained.
  • H22 never asks for the backlog cleanup that was refused — its window covers residue
    produced now, while the paired write is still a live duty someone remembers.

If the PM reads 「普查时不应该只看open的卡片吗」 as reaching H22 too, that is a one-line
change to h22ClosedCardPmResidue and belongs on its own card rather than smuggled in here.

Verification

Authored by Claude Code session session_01EnE7G31tqbxN1rqpQmzurT (durable attribution
copy — a body edit rewrites the footer below).

  • node scripts/pm/check-half-states.mjs --self-testbefore:
    ✓ check-half-states self-test: 1791 cases pass. (exit 0). After:
    ✓ check-half-states self-test: 1826 cases pass. (exit 0). 35 new pins.
  • Reverse verification, three ablations, each committed first, each confirmed on disk by
    counting the injected and the original spelling, each restored and the restore proved by
    git hash-object equality against the HEAD blob:
    • the open-state scoping widened to all states in pmLabelListingPath8 pins red, exit 1.
    • an alarm glyph injected into the census line — 2 pins red, exit 1.
    • global-oldest reverted to the bare find2 pins red, exit 1.
  • Gate families derived from the real diff via node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (exit 0; it reads the merge-base change set itself). 17 derived
    plus 2 convention-triggered for a gate-script edit. 16 green; three are not readings and
    say so themselves: check-partof-closing-keyword exits 2 NOT WIRED without a PR body in the
    environment (its pnpm check:partof-closing-keyword spelling is green, and this body was
    checked against it separately), check-test-completeness exits 3 and instructs the local
    family runner to record NOT MEASURED, and the livecheck-half-states sweep exits 3
    PREREQUISITE NOT MET because this container's session gate refuses repo-scoped reads.
  • pnpm lint (repo-wide eslint . --no-inline-config, no narrowing) — exit 0, 103s.
  • node scripts/check-nul-bytes.mjs — OK, 7,574 text files, no raw control bytes.
  • Union re-run on the final commit 54f5b104 — the gate families above, pnpm lint and the
    self-test all ran on that tree, which is this PR head.

No changeset: the diff is scripts/pm/** only, which publishes from no package — the
skip-changeset closed list. The label is applied on this PR.

Refs: #13526 and PR #13601 (the census leg being re-judged) · #13597.

Generated by Claude Code

…residue census
Reader-side audit ruled by the maintainer on 2026-08-31 (第 6 场总监席决裁批 #13):
closed cards carrying pm:* state are archive, not state. No bulk strip, no
backfill, no reaper — the residue is made harmless by open-scoped readers.
- Extract `pmLabelListingPath`, the one place `state=open` is asserted on a
pm:*-label listing, and pin it (every residue label, encoding, page).
- Collapse the H39 census render from a per-lane table with page-cap and
control alarms to ONE informational line, italic in markdown, no alarm
glyphs, no finding row. Instrument caveats (#4690) survive as a qualifier.
- Re-judge the H39 self-test pins that pinned the removed render branches.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EnE7G31tqbxN1rqpQmzurT
…st label's
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EnE7G31tqbxN1rqpQmzurT
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

2 participants

@huangyiirene@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(pm): scope pm:* label queries to open cards, re-judge the closed-residue census - #13752

Merged
huangyiirene merged 2 commits into
mainfrom
claude/issue-13605-pm-state-open-audit
Aug 31, 2026
Merged

fix(pm): scope pm:* label queries to open cards, re-judge the closed-residue census#13752
huangyiirene merged 2 commits into
mainfrom
claude/issue-13605-pm-state-open-audit

Conversation

@huangyiirene

@huangyiirenehuangyiirene commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Fixes#13605

Reader-side audit of every pm:*-label issue query, plus the census-leg re-judgment,
under the maintainer ruling of 2026-08-31 (第 6 场总监席决裁批 #13), verbatim and
untranslated:

「13605 已关卡 为什么要清理。普查时不应该只看open的卡片吗,其他同意」

No bulk strip, no backfill, no reaper. The ~3,000 closed cards carrying pm:* stay as
they are; what makes them harmless is that every reader selecting by a pm:* label
scopes itself to open cards.

Item ① — the reader audit

Population: call sites in scripts/pm/**, and the patrol paths those scripts drive,
that query issues by pm:* labels. Enumerated by reading every API call site in the
tree, not by sampling.

Result: 2 sites in population. Both were already open-scoped or deliberately closed-scoped —
zero sites were missing an open-state filter.
The audit's value is therefore a pin, not a
repair: the scoping that the whole ruling rests on was an incidental detail of one inline
template, and nothing would have gone red if a later edit had widened it.

sitequeries pm:* howopen filter beforeverdict / fix
listIssues()check-half-states.mjsGET /issues with state=open plus labels=LABEL, one page-loop per state label (7 labels)state=openpresentcompliant — extracted to pmLabelListingPath(), now the single place the scoping is asserted, with the ruling cited in its docblock and 11 self-test pins behind it
censusClosedPmResidue()check-half-states.mjsGET /issues with state=closed plus labels=LABEL, fully paginated, one pass per residue labelstate=closedby designre-judged — see item ②

Out of population — measured, not assumed

Closed-card readers that do not select by a pm:* label (they read residue locally
from rows fetched for another reason):

sitewhy it is out
listRecentlyClosedIssues() (drives H22)no label filter; a 3-day closure window, residue read from the returned rows
census control queryGET /issues with state=closed, deliberately unfiltered — it is the instrument control

Issue/PR queries that never touch a pm:* label: listAllOpenIssues() (already
open-scoped), listOpenPrs(), listRecentlyMergedPrs(), the per-card comment fetch, PR
detail, PR files, the Blocked-by: target read, the repo probe, the commit window and the
issue-event window — all by number or unfiltered.

Scripts that query no issues at all by pm:* label, so they are out of population
entirely — this is the "measure, don't assume" half the dispatch asked for:

  • ci-failure.mjs — check-runs, annotations, action runs/jobs, one PR by number.
  • check-governed-merges.mjs — one PR by number.
  • check-governed-queue-guard.mjs — one PR's reviews and head.
  • check-label-desc-cap.mjs — its two pm: strings are self-test fixture text inside a
    gh label create line; it makes no API call.
  • dispatch-gates.mjs — no API calls; its only pm: grep hit is pnpm: inside a
    variable name, not a label.
  • ensure-pm-labels.sh — creates and reconciles label objects; never queries issues.
  • bare-root-worklist.mjs, check-dispatch-gates.mjs, check-governed-prose.mjs,
    check-skill-id-lint.mjs, check-skill-line-ratchet.mjs, git-history.mjs,
    release-rehearsal-clone.mjs, os-verify-lock.sh, os-regen-merge.sh — no API calls.
  • .github/workflows/half-state-patrol.yml, the only patrol path these scripts drive —
    its sole API write is an anchor-issue update; it runs no label query.

Item ② — the census leg, re-judged

renderClosedResidueCensus went from a block (bold heading, a row per label, a nested row
per lane, a page-cap alarm, a control-failure alarm, a contradictory-pair roster, and two
closing warnings) to one informational line, italic in markdown — the styling the
healthy rate premise already uses, deliberately not the bold heading a finding block wears.

Closed-card `pm:*` residue (H39 census, informational): pm:dispatched 2064, pm:queue 846,
pm:blocking 27, pm:blocked 18, pm:on-hold 13, pm:awaiting-maintainer 2, oldest closed
2026-08-02; 555 carrying both `pm:queue` and `pm:dispatched`. Archive, not state — no
cleanup is owed and none is planned (ruled 2026-08-31, 批 #13); readers scope `pm:*`
queries to open cards.

What was kept and why:

  • The gathering is unchanged. The figures are the informational line's content, and the
    cost lands on the patrol workflow's own runner token (15,000/h core), not on the shared
    agent pool the 2026-08-16 ruling protects.
  • The #4690 instrument caveats survive, demoted to a parenthesis. A page cap is still
    not a count and an empty control still means "not read" — that is about the instrument,
    and the ruling was about the board. censusIsCountable is untouched. The two caveats
    are now mutually exclusive on the line, and a pin refuses the naive fallback that would
    let a capped census also blame the control.
  • One bug found while collapsing it: the old "oldest closed" reading took a bare find
    over rows — the first row carrying an oldest — and rows is sorted by size, so it
    reported the oldest closure of the largest label while reading as the population's
    floor. Now a global minimum, with a pin whose fixture puts the real floor on the smaller
    label.

Why H22 was left alone — stated because it is the one judgment call here

H22 also reports pm:* residue on closed cards, and as finding rows. It is deliberately
not changed, and the PM should confirm this reading:

  • Item ② of the ruling names one leg: the census leg (H39). H22 predates it and is a
    different shape.
  • Item ③ keeps close-time hygiene as the convention. H22, bounded to a 3-day closure
    window, is the only mechanism that observes that convention; deleting it would silently
    retire a rule the ruling explicitly retained.
  • H22 never asks for the backlog cleanup that was refused — its window covers residue
    produced now, while the paired write is still a live duty someone remembers.

If the PM reads 「普查时不应该只看open的卡片吗」 as reaching H22 too, that is a one-line
change to h22ClosedCardPmResidue and belongs on its own card rather than smuggled in here.

Verification

Authored by Claude Code session session_01EnE7G31tqbxN1rqpQmzurT (durable attribution
copy — a body edit rewrites the footer below).

  • node scripts/pm/check-half-states.mjs --self-testbefore:
    ✓ check-half-states self-test: 1791 cases pass. (exit 0). After:
    ✓ check-half-states self-test: 1826 cases pass. (exit 0). 35 new pins.
  • Reverse verification, three ablations, each committed first, each confirmed on disk by
    counting the injected and the original spelling, each restored and the restore proved by
    git hash-object equality against the HEAD blob:
    • the open-state scoping widened to all states in pmLabelListingPath8 pins red, exit 1.
    • an alarm glyph injected into the census line — 2 pins red, exit 1.
    • global-oldest reverted to the bare find2 pins red, exit 1.
  • Gate families derived from the real diff via node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (exit 0; it reads the merge-base change set itself). 17 derived
    plus 2 convention-triggered for a gate-script edit. 16 green; three are not readings and
    say so themselves: check-partof-closing-keyword exits 2 NOT WIRED without a PR body in the
    environment (its pnpm check:partof-closing-keyword spelling is green, and this body was
    checked against it separately), check-test-completeness exits 3 and instructs the local
    family runner to record NOT MEASURED, and the livecheck-half-states sweep exits 3
    PREREQUISITE NOT MET because this container's session gate refuses repo-scoped reads.
  • pnpm lint (repo-wide eslint . --no-inline-config, no narrowing) — exit 0, 103s.
  • node scripts/check-nul-bytes.mjs — OK, 7,574 text files, no raw control bytes.
  • Union re-run on the final commit 54f5b104 — the gate families above, pnpm lint and the
    self-test all ran on that tree, which is this PR head.

No changeset: the diff is scripts/pm/** only, which publishes from no package — the
skip-changeset closed list. The label is applied on this PR.

Refs: #13526 and PR #13601 (the census leg being re-judged) · #13597.

Generated by Claude Code

…residue census
Reader-side audit ruled by the maintainer on 2026-08-31 (第 6 场总监席决裁批 #13):
closed cards carrying pm:* state are archive, not state. No bulk strip, no
backfill, no reaper — the residue is made harmless by open-scoped readers.
- Extract `pmLabelListingPath`, the one place `state=open` is asserted on a
pm:*-label listing, and pin it (every residue label, encoding, page).
- Collapse the H39 census render from a per-lane table with page-cap and
control alarms to ONE informational line, italic in markdown, no alarm
glyphs, no finding row. Instrument caveats (#4690) survive as a qualifier.
- Re-judge the H39 self-test pins that pinned the removed render branches.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EnE7G31tqbxN1rqpQmzurT
…st label's
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EnE7G31tqbxN1rqpQmzurT
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

2 participants

@huangyiirene@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(pm): scope pm:* label queries to open cards, re-judge the closed-residue census - #13752

Merged
huangyiirene merged 2 commits into
mainfrom
claude/issue-13605-pm-state-open-audit
Aug 31, 2026
Merged

fix(pm): scope pm:* label queries to open cards, re-judge the closed-residue census#13752
huangyiirene merged 2 commits into
mainfrom
claude/issue-13605-pm-state-open-audit

Conversation

@huangyiirene

@huangyiirenehuangyiirene commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Fixes#13605

Reader-side audit of every pm:*-label issue query, plus the census-leg re-judgment,
under the maintainer ruling of 2026-08-31 (第 6 场总监席决裁批 #13), verbatim and
untranslated:

「13605 已关卡 为什么要清理。普查时不应该只看open的卡片吗,其他同意」

No bulk strip, no backfill, no reaper. The ~3,000 closed cards carrying pm:* stay as
they are; what makes them harmless is that every reader selecting by a pm:* label
scopes itself to open cards.

Item ① — the reader audit

Population: call sites in scripts/pm/**, and the patrol paths those scripts drive,
that query issues by pm:* labels. Enumerated by reading every API call site in the
tree, not by sampling.

Result: 2 sites in population. Both were already open-scoped or deliberately closed-scoped —
zero sites were missing an open-state filter.
The audit's value is therefore a pin, not a
repair: the scoping that the whole ruling rests on was an incidental detail of one inline
template, and nothing would have gone red if a later edit had widened it.

sitequeries pm:* howopen filter beforeverdict / fix
listIssues()check-half-states.mjsGET /issues with state=open plus labels=LABEL, one page-loop per state label (7 labels)state=openpresentcompliant — extracted to pmLabelListingPath(), now the single place the scoping is asserted, with the ruling cited in its docblock and 11 self-test pins behind it
censusClosedPmResidue()check-half-states.mjsGET /issues with state=closed plus labels=LABEL, fully paginated, one pass per residue labelstate=closedby designre-judged — see item ②

Out of population — measured, not assumed

Closed-card readers that do not select by a pm:* label (they read residue locally
from rows fetched for another reason):

sitewhy it is out
listRecentlyClosedIssues() (drives H22)no label filter; a 3-day closure window, residue read from the returned rows
census control queryGET /issues with state=closed, deliberately unfiltered — it is the instrument control

Issue/PR queries that never touch a pm:* label: listAllOpenIssues() (already
open-scoped), listOpenPrs(), listRecentlyMergedPrs(), the per-card comment fetch, PR
detail, PR files, the Blocked-by: target read, the repo probe, the commit window and the
issue-event window — all by number or unfiltered.

Scripts that query no issues at all by pm:* label, so they are out of population
entirely — this is the "measure, don't assume" half the dispatch asked for:

  • ci-failure.mjs — check-runs, annotations, action runs/jobs, one PR by number.
  • check-governed-merges.mjs — one PR by number.
  • check-governed-queue-guard.mjs — one PR's reviews and head.
  • check-label-desc-cap.mjs — its two pm: strings are self-test fixture text inside a
    gh label create line; it makes no API call.
  • dispatch-gates.mjs — no API calls; its only pm: grep hit is pnpm: inside a
    variable name, not a label.
  • ensure-pm-labels.sh — creates and reconciles label objects; never queries issues.
  • bare-root-worklist.mjs, check-dispatch-gates.mjs, check-governed-prose.mjs,
    check-skill-id-lint.mjs, check-skill-line-ratchet.mjs, git-history.mjs,
    release-rehearsal-clone.mjs, os-verify-lock.sh, os-regen-merge.sh — no API calls.
  • .github/workflows/half-state-patrol.yml, the only patrol path these scripts drive —
    its sole API write is an anchor-issue update; it runs no label query.

Item ② — the census leg, re-judged

renderClosedResidueCensus went from a block (bold heading, a row per label, a nested row
per lane, a page-cap alarm, a control-failure alarm, a contradictory-pair roster, and two
closing warnings) to one informational line, italic in markdown — the styling the
healthy rate premise already uses, deliberately not the bold heading a finding block wears.

Closed-card `pm:*` residue (H39 census, informational): pm:dispatched 2064, pm:queue 846,
pm:blocking 27, pm:blocked 18, pm:on-hold 13, pm:awaiting-maintainer 2, oldest closed
2026-08-02; 555 carrying both `pm:queue` and `pm:dispatched`. Archive, not state — no
cleanup is owed and none is planned (ruled 2026-08-31, 批 #13); readers scope `pm:*`
queries to open cards.

What was kept and why:

  • The gathering is unchanged. The figures are the informational line's content, and the
    cost lands on the patrol workflow's own runner token (15,000/h core), not on the shared
    agent pool the 2026-08-16 ruling protects.
  • The #4690 instrument caveats survive, demoted to a parenthesis. A page cap is still
    not a count and an empty control still means "not read" — that is about the instrument,
    and the ruling was about the board. censusIsCountable is untouched. The two caveats
    are now mutually exclusive on the line, and a pin refuses the naive fallback that would
    let a capped census also blame the control.
  • One bug found while collapsing it: the old "oldest closed" reading took a bare find
    over rows — the first row carrying an oldest — and rows is sorted by size, so it
    reported the oldest closure of the largest label while reading as the population's
    floor. Now a global minimum, with a pin whose fixture puts the real floor on the smaller
    label.

Why H22 was left alone — stated because it is the one judgment call here

H22 also reports pm:* residue on closed cards, and as finding rows. It is deliberately
not changed, and the PM should confirm this reading:

  • Item ② of the ruling names one leg: the census leg (H39). H22 predates it and is a
    different shape.
  • Item ③ keeps close-time hygiene as the convention. H22, bounded to a 3-day closure
    window, is the only mechanism that observes that convention; deleting it would silently
    retire a rule the ruling explicitly retained.
  • H22 never asks for the backlog cleanup that was refused — its window covers residue
    produced now, while the paired write is still a live duty someone remembers.

If the PM reads 「普查时不应该只看open的卡片吗」 as reaching H22 too, that is a one-line
change to h22ClosedCardPmResidue and belongs on its own card rather than smuggled in here.

Verification

Authored by Claude Code session session_01EnE7G31tqbxN1rqpQmzurT (durable attribution
copy — a body edit rewrites the footer below).

  • node scripts/pm/check-half-states.mjs --self-testbefore:
    ✓ check-half-states self-test: 1791 cases pass. (exit 0). After:
    ✓ check-half-states self-test: 1826 cases pass. (exit 0). 35 new pins.
  • Reverse verification, three ablations, each committed first, each confirmed on disk by
    counting the injected and the original spelling, each restored and the restore proved by
    git hash-object equality against the HEAD blob:
    • the open-state scoping widened to all states in pmLabelListingPath8 pins red, exit 1.
    • an alarm glyph injected into the census line — 2 pins red, exit 1.
    • global-oldest reverted to the bare find2 pins red, exit 1.
  • Gate families derived from the real diff via node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (exit 0; it reads the merge-base change set itself). 17 derived
    plus 2 convention-triggered for a gate-script edit. 16 green; three are not readings and
    say so themselves: check-partof-closing-keyword exits 2 NOT WIRED without a PR body in the
    environment (its pnpm check:partof-closing-keyword spelling is green, and this body was
    checked against it separately), check-test-completeness exits 3 and instructs the local
    family runner to record NOT MEASURED, and the livecheck-half-states sweep exits 3
    PREREQUISITE NOT MET because this container's session gate refuses repo-scoped reads.
  • pnpm lint (repo-wide eslint . --no-inline-config, no narrowing) — exit 0, 103s.
  • node scripts/check-nul-bytes.mjs — OK, 7,574 text files, no raw control bytes.
  • Union re-run on the final commit 54f5b104 — the gate families above, pnpm lint and the
    self-test all ran on that tree, which is this PR head.

No changeset: the diff is scripts/pm/** only, which publishes from no package — the
skip-changeset closed list. The label is applied on this PR.

Refs: #13526 and PR #13601 (the census leg being re-judged) · #13597.

Generated by Claude Code

…residue census
Reader-side audit ruled by the maintainer on 2026-08-31 (第 6 场总监席决裁批 #13):
closed cards carrying pm:* state are archive, not state. No bulk strip, no
backfill, no reaper — the residue is made harmless by open-scoped readers.
- Extract `pmLabelListingPath`, the one place `state=open` is asserted on a
pm:*-label listing, and pin it (every residue label, encoding, page).
- Collapse the H39 census render from a per-lane table with page-cap and
control alarms to ONE informational line, italic in markdown, no alarm
glyphs, no finding row. Instrument caveats (#4690) survive as a qualifier.
- Re-judge the H39 self-test pins that pinned the removed render branches.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EnE7G31tqbxN1rqpQmzurT
…st label's
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EnE7G31tqbxN1rqpQmzurT
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

2 participants

@huangyiirene@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

fix(pm): scope pm:* label queries to open cards, re-judge the closed-residue census - #13752

Merged
huangyiirene merged 2 commits into
mainfrom
claude/issue-13605-pm-state-open-audit
Aug 31, 2026
Merged

fix(pm): scope pm:* label queries to open cards, re-judge the closed-residue census#13752
huangyiirene merged 2 commits into
mainfrom
claude/issue-13605-pm-state-open-audit

Conversation

@huangyiirene

@huangyiirenehuangyiirene commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Fixes#13605

Reader-side audit of every pm:*-label issue query, plus the census-leg re-judgment,
under the maintainer ruling of 2026-08-31 (第 6 场总监席决裁批 #13), verbatim and
untranslated:

「13605 已关卡 为什么要清理。普查时不应该只看open的卡片吗,其他同意」

No bulk strip, no backfill, no reaper. The ~3,000 closed cards carrying pm:* stay as
they are; what makes them harmless is that every reader selecting by a pm:* label
scopes itself to open cards.

Item ① — the reader audit

Population: call sites in scripts/pm/**, and the patrol paths those scripts drive,
that query issues by pm:* labels. Enumerated by reading every API call site in the
tree, not by sampling.

Result: 2 sites in population. Both were already open-scoped or deliberately closed-scoped —
zero sites were missing an open-state filter.
The audit's value is therefore a pin, not a
repair: the scoping that the whole ruling rests on was an incidental detail of one inline
template, and nothing would have gone red if a later edit had widened it.

sitequeries pm:* howopen filter beforeverdict / fix
listIssues()check-half-states.mjsGET /issues with state=open plus labels=LABEL, one page-loop per state label (7 labels)state=openpresentcompliant — extracted to pmLabelListingPath(), now the single place the scoping is asserted, with the ruling cited in its docblock and 11 self-test pins behind it
censusClosedPmResidue()check-half-states.mjsGET /issues with state=closed plus labels=LABEL, fully paginated, one pass per residue labelstate=closedby designre-judged — see item ②

Out of population — measured, not assumed

Closed-card readers that do not select by a pm:* label (they read residue locally
from rows fetched for another reason):

sitewhy it is out
listRecentlyClosedIssues() (drives H22)no label filter; a 3-day closure window, residue read from the returned rows
census control queryGET /issues with state=closed, deliberately unfiltered — it is the instrument control

Issue/PR queries that never touch a pm:* label: listAllOpenIssues() (already
open-scoped), listOpenPrs(), listRecentlyMergedPrs(), the per-card comment fetch, PR
detail, PR files, the Blocked-by: target read, the repo probe, the commit window and the
issue-event window — all by number or unfiltered.

Scripts that query no issues at all by pm:* label, so they are out of population
entirely — this is the "measure, don't assume" half the dispatch asked for:

  • ci-failure.mjs — check-runs, annotations, action runs/jobs, one PR by number.
  • check-governed-merges.mjs — one PR by number.
  • check-governed-queue-guard.mjs — one PR's reviews and head.
  • check-label-desc-cap.mjs — its two pm: strings are self-test fixture text inside a
    gh label create line; it makes no API call.
  • dispatch-gates.mjs — no API calls; its only pm: grep hit is pnpm: inside a
    variable name, not a label.
  • ensure-pm-labels.sh — creates and reconciles label objects; never queries issues.
  • bare-root-worklist.mjs, check-dispatch-gates.mjs, check-governed-prose.mjs,
    check-skill-id-lint.mjs, check-skill-line-ratchet.mjs, git-history.mjs,
    release-rehearsal-clone.mjs, os-verify-lock.sh, os-regen-merge.sh — no API calls.
  • .github/workflows/half-state-patrol.yml, the only patrol path these scripts drive —
    its sole API write is an anchor-issue update; it runs no label query.

Item ② — the census leg, re-judged

renderClosedResidueCensus went from a block (bold heading, a row per label, a nested row
per lane, a page-cap alarm, a control-failure alarm, a contradictory-pair roster, and two
closing warnings) to one informational line, italic in markdown — the styling the
healthy rate premise already uses, deliberately not the bold heading a finding block wears.

Closed-card `pm:*` residue (H39 census, informational): pm:dispatched 2064, pm:queue 846,
pm:blocking 27, pm:blocked 18, pm:on-hold 13, pm:awaiting-maintainer 2, oldest closed
2026-08-02; 555 carrying both `pm:queue` and `pm:dispatched`. Archive, not state — no
cleanup is owed and none is planned (ruled 2026-08-31, 批 #13); readers scope `pm:*`
queries to open cards.

What was kept and why:

  • The gathering is unchanged. The figures are the informational line's content, and the
    cost lands on the patrol workflow's own runner token (15,000/h core), not on the shared
    agent pool the 2026-08-16 ruling protects.
  • The #4690 instrument caveats survive, demoted to a parenthesis. A page cap is still
    not a count and an empty control still means "not read" — that is about the instrument,
    and the ruling was about the board. censusIsCountable is untouched. The two caveats
    are now mutually exclusive on the line, and a pin refuses the naive fallback that would
    let a capped census also blame the control.
  • One bug found while collapsing it: the old "oldest closed" reading took a bare find
    over rows — the first row carrying an oldest — and rows is sorted by size, so it
    reported the oldest closure of the largest label while reading as the population's
    floor. Now a global minimum, with a pin whose fixture puts the real floor on the smaller
    label.

Why H22 was left alone — stated because it is the one judgment call here

H22 also reports pm:* residue on closed cards, and as finding rows. It is deliberately
not changed, and the PM should confirm this reading:

  • Item ② of the ruling names one leg: the census leg (H39). H22 predates it and is a
    different shape.
  • Item ③ keeps close-time hygiene as the convention. H22, bounded to a 3-day closure
    window, is the only mechanism that observes that convention; deleting it would silently
    retire a rule the ruling explicitly retained.
  • H22 never asks for the backlog cleanup that was refused — its window covers residue
    produced now, while the paired write is still a live duty someone remembers.

If the PM reads 「普查时不应该只看open的卡片吗」 as reaching H22 too, that is a one-line
change to h22ClosedCardPmResidue and belongs on its own card rather than smuggled in here.

Verification

Authored by Claude Code session session_01EnE7G31tqbxN1rqpQmzurT (durable attribution
copy — a body edit rewrites the footer below).

  • node scripts/pm/check-half-states.mjs --self-testbefore:
    ✓ check-half-states self-test: 1791 cases pass. (exit 0). After:
    ✓ check-half-states self-test: 1826 cases pass. (exit 0). 35 new pins.
  • Reverse verification, three ablations, each committed first, each confirmed on disk by
    counting the injected and the original spelling, each restored and the restore proved by
    git hash-object equality against the HEAD blob:
    • the open-state scoping widened to all states in pmLabelListingPath8 pins red, exit 1.
    • an alarm glyph injected into the census line — 2 pins red, exit 1.
    • global-oldest reverted to the bare find2 pins red, exit 1.
  • Gate families derived from the real diff via node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack (exit 0; it reads the merge-base change set itself). 17 derived
    plus 2 convention-triggered for a gate-script edit. 16 green; three are not readings and
    say so themselves: check-partof-closing-keyword exits 2 NOT WIRED without a PR body in the
    environment (its pnpm check:partof-closing-keyword spelling is green, and this body was
    checked against it separately), check-test-completeness exits 3 and instructs the local
    family runner to record NOT MEASURED, and the livecheck-half-states sweep exits 3
    PREREQUISITE NOT MET because this container's session gate refuses repo-scoped reads.
  • pnpm lint (repo-wide eslint . --no-inline-config, no narrowing) — exit 0, 103s.
  • node scripts/check-nul-bytes.mjs — OK, 7,574 text files, no raw control bytes.
  • Union re-run on the final commit 54f5b104 — the gate families above, pnpm lint and the
    self-test all ran on that tree, which is this PR head.

No changeset: the diff is scripts/pm/** only, which publishes from no package — the
skip-changeset closed list. The label is applied on this PR.

Refs: #13526 and PR #13601 (the census leg being re-judged) · #13597.

Generated by Claude Code

…residue census
Reader-side audit ruled by the maintainer on 2026-08-31 (第 6 场总监席决裁批 #13):
closed cards carrying pm:* state are archive, not state. No bulk strip, no
backfill, no reaper — the residue is made harmless by open-scoped readers.
- Extract `pmLabelListingPath`, the one place `state=open` is asserted on a
pm:*-label listing, and pin it (every residue label, encoding, page).
- Collapse the H39 census render from a per-lane table with page-cap and
control alarms to ONE informational line, italic in markdown, no alarm
glyphs, no finding row. Instrument caveats (#4690) survive as a qualifier.
- Re-judge the H39 self-test pins that pinned the removed render branches.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EnE7G31tqbxN1rqpQmzurT
…st label's
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EnE7G31tqbxN1rqpQmzurT
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/mskip-changesetPR has no user-facing published change; bypasses the changeset gate

Projects

None yet

2 participants

@huangyiirene@claude