Skip to content

ci(fleet-patrols): the weekly audit card's readings move into check-governed-merges, each with a self-test row - #33982

Merged
os-zhuang merged 4 commits into
mainfrom
claude/project-thread-gxa5jr
Nov 15, 2026
Merged

os-zhuang merged 4 commits into
mainfrom
claude/project-thread-gxa5jr

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Part of #33814

domain:skills#1 · os-steve · session_01ADHkmQ9yJPqAUnGqQvBK47

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:每周治理合并审计(Fleet Patrols 的 governed-merges-audit)开卡/刷新卡的读法,从工作流里的内联脚本搬进 scripts/pm/check-governed-merges.mjs,并修掉评审留下的读法缺陷;工作流只保留 API 调用。
  • 为什么改:这些读法以前没有自测,评审挑出的十几处(没有 PR 号的治理提交被读成干净、卡片正文可能超长被拒、非审批人账号(中继机器人、stale 机器人)或合并时的关闭关键字关卡被当成你的裁决等;仍有一个已写明的残余:席位用审批人账号关卡,会被读成该审批人的裁决)都只能靠人看;现在每处都有正反两向的自测行。
  • 风险与回滚:只影响审计卡怎么写,不改排程、不改卡的标签和标题、不改审计的范围;方向都是宁可多报一行。回滚就是 revert 本 PR。
  • 先看:① .github/workflows/fleet-patrols.yml 的「File or refresh the audit card」一步(先发评论再改正文、读关卡事件);② scripts/pm/check-governed-merges.mjs 新增的 ruledAuditRows / auditCloseRuling(谁关卡才算裁决,按账号判断);③ 同文件 composeAuditCard 的正文长度限制。
  • 两分钟验证:node scripts/pm/check-governed-merges.mjs --self-test,应看到 ✓ check-governed-merges --self-test: 799 assertions,结尾提到 weekly audit card。
  • 需要你做的:审一下这个 draft PR,同意后批准(工作流文件是受管面,需要 GOVERNED_APPROVERS 批准后由席位落地)。

What changes

The weekly governed-merges audit job's two github-script steps now import their readings from scripts/pm/check-governed-merges.mjs and keep only the I/O: readAuditSweep (sweep JSON → findings), readAuditCardRows (card body → keyed rows), ruledAuditRows / auditCloseRuling (closed cards → the rows they rule), composeAuditCard (findings + open card → next body and comment). The job's schedule, card identity (label, marker, title), state label and what it audits are unchanged.

Review follow-ups of PR #33766, triaged per item:

  • N4 a governed landing whose subject names no PR now reads NOT MEASURED (it read clean: the sweep lists it but reads no merge, review or record for it).
  • N5 the watchdog header says five jobs on five clocks.
  • N8 the body is fitted under 60,000 characters (GitHub refuses over 65,536): the quoted stderr, then NOT MEASURED rows, then BREACH rows from the tail; one row's text is cut at 1,000 characters. The BREACH heading and the refresh comment count the rows ON the card and name the overflow apart.
  • N9 the refresh comment is posted BEFORE the body is rewritten (a failed comment now leaves the old body, so the rows are announced again rather than never); a carried row the run read in another state says which state.
  • N10 a closed card rules only when the actor login of its last closed event is in the queue guard's GOVERNED_APPROVERS and the event names no commit: any other account's close (the relay bot, the stale bot), a closing keyword (the event names a commit) or an unreadable event rules nothing. ⚠️ It is a login test: a seat session on an approver's account reads as that approver's close (see S1).
  • N12 every ruling card within the horizon counts, not only the newest closed card.
  • N13 keyed rows outside every section the audit reads (a reworded heading, a row moved above the first heading) are counted and named in the refresh comment.
  • N14/N16/N17 the section reader skips fenced blocks, stops at the LAST footer (or its second line alone), and the comment says when no footer was found.
  • N15 the ruled horizon is its own constant (AUDIT_CARD.ruledHorizonDays, 10, pinned ≥ 7 d + the 1 h skew budget); AUDIT_HISTORY_DAYS's comment says it is the clone depth only, and the overstated "a reused key is never hidden" is gone.
  • N18 the card body states the day bound and who rules.
  • S1 (review 6896878561, delta 6897204057) worded as the login test it is: the header, the docstring, the card text and this body say a close rules only when its actor login is in GOVERNED_APPROVERS and it names no commit, and name the residual (a seat session on an approver's account reads as that approver's close). The close event's performed_via_github_app is passed through as served and read best-effort, by presence: absent ⇒ unreadable, rules nothing; an object (named or not) ⇒ rules nothing; null ⇒ the login test decides. The platform serves it null on every close event today (measured 2026-11-15 on the issue-events and timeline endpoints), so the object branch does not fire today.
  • S2 a fence on the card closes only on its own marker (same character, at least as long, nothing after it); a fence left open is reported in the refresh comment; the quoted stderr defuses tilde fences as well as backticks.
  • S3 BREACH rows that do not fit the card are named by key in the refresh comment, split into this run's (in its run log and artifact) and carried ones (held by no run's reading, so the comment is their last record); the body no longer claims the run log holds carried rows. The dropped-key list is capped (500 per group, then a count), and a row that did not fit is no longer announced as new to the card.
  • N1 left open: the record-carry leg diffs the reviewed head against the landed head (lowRiskRecordVerdict), and the job's single-branch mirror holds no pull-request head commits. A fix needs the arm leg to name the commits it lacked (the arm region of this script, held by review follow-ups of PR #33762 #33765) and the clone step to fetch them before a re-sweep; outside this card's surface. The job header now documents the gap.
  • N7 left open: a row the runner can never read is answered only by leaving the window. A fix is either N1's fetch or a card that accepts a seat's local re-read as the answer, which changes the card's Maintainer-action: contract (the maintainer's ruling); the header documents the gap and the PR-less row's own text says a re-run reads it the same way. N4 widens this class by design (a PR-less governed landing can never be read by a re-run), so it stays under N7 on the card.

Tests

  • New battery ⭐ the weekly audit card: every reading the job files on, both ways (#33814): 54 cases, floor pinned at 54; roster floor 38 → 39. Each fixed reading is pinned with its control (the neighbouring input that must still read as before); the card step's write order and the export names the job calls are read off the workflow file itself.
  • node scripts/pm/check-governed-merges.mjs --self-test → exit 0, 799 assertions.
  • node scripts/check-platform-checklist-watchdog.mjs --self-test → exit 0 (53 assertions); the gate itself → exit 0.
  • Workflow YAML parses (yaml); both github-script bodies were run end to end against a fake github client (create and refresh scenarios), offline.
  • No forced test edits.

Acceptance notes

  • stale.yml does not exempt the governed-merges-audit label (exempt-issue-labels: 'pinned,security,roadmap,tracking'), so an open audit card idle for 74 days is closed as not planned. After this PR such a close rules nothing (its rows are announced again while in the window), but its carried rows outside the window are lost. The fix is a one-word edit to another workflow file, outside this card's surface. carrier: domain:skills seat.

Verification

Gates: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack on the final head, each command run, reconciled with --ran (head 77b6b46: 56 derived, 56 run, all exit 0; --ran: "56 derived famil(ies) accounted for — 56 run, 0 NOT-MEASURED". CI-run families are read from this PR's check-runs, not re-run locally).


Generated by Claude Code

…overned-merges with self-test rows

The governed-merges-audit job's two github-script steps now import their
readings from scripts/pm/check-governed-merges.mjs (readAuditSweep,
readAuditCardRows, ruledAuditRows, composeAuditCard) and keep only the API
calls. The review follow-ups of the job's PR are fixed there, each pinned
both ways in a new self-test battery:

- a governed landing with no PR number reads NOT MEASURED, never clean;
- the card body is fitted under the issue-body limit, and the BREACH
  heading and refresh comment count the rows on the card;
- the refresh comment is posted before the body is rewritten, and a
  carried row names the state this run read it in;
- a closed card rules only when an authorized approver closed it by hand
  (not a seat, a closing keyword or the stale bot), and every such card in
  the horizon counts, not only the newest;
- the section reader skips fenced blocks, stops at the last footer (or its
  second line), and counts keyed rows outside every known section;
- the ruled horizon is its own constant, and the card text states it.

The watchdog header now says five jobs.

Claude-Session: https://claude.ai/code/session_01ADHkmQ9yJPqAUnGqQvBK47
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 15, 2026
@objectstack-fleet objectstack-fleet Bot mentioned this pull request Nov 15, 2026
10 of 12 tasks
- an approver's account closing the card through a GitHub App is a seat
  session and rules nothing; the job passes the close event's
  performed_via_github_app through;
- a fence on the card closes only on its own marker (same character, at
  least as long, nothing after it), a fence left open is reported in the
  refresh comment, and the quoted stderr defuses tilde fences too;
- BREACH rows that do not fit the card are named in the refresh comment,
  and a dropped carried row is no longer said to be in the run log.

Claude-Session: https://claude.ai/code/session_01ADHkmQ9yJPqAUnGqQvBK47
Co-authored-by: Claude <noreply@anthropic.com>
…n test it is

The close event's performed_via_github_app is read by presence (absent:
unreadable, rules nothing; an object, named or not: rules nothing; null:
the login test decides) and passed through as served. The platform serves
it null on every close event today, so the header, the docstring and the
card text now say what decides: the actor login is in GOVERNED_APPROVERS
and the event names no commit, with the seat-on-an-approver's-account
residual named. A row that did not fit is no longer announced as new to
the card, and the dropped-key list is capped with a count.

Claude-Session: https://claude.ai/code/session_01ADHkmQ9yJPqAUnGqQvBK47
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#1 · os-steve · session_01ADHkmPd7uRqHauEehGPr19

维护者速读

  • 改了什么:每周治理合并审计(governed-merges-audit)开卡、刷新卡的读法,从工作流内联脚本搬进 scripts/pm/check-governed-merges.mjs 的纯函数,并修掉审阅列出的读法缺陷;工作流只留 API 调用,权限不变。
  • 为什么改:这些读法以前没有自测。缺陷包括:没有 PR 号的治理提交被读成干净;卡正文可能超长被拒;中继机器人、stale 机器人关卡,或合并时的关闭关键字关卡,被当成您的裁决。现在每处都有正反两向的自测行(审计电池 54 条)。
  • 风险与回滚:只影响审计卡怎么写,不改排程、标签、标题和审计范围,出错方向都是多报一行。回滚即 revert 本 PR。
  • 先看:① fleet-patrols.yml 的「File or refresh the audit card」一步(先评论后改正文);② auditCloseRuling(谁关卡才算裁决);③ composeAuditCard 的长度限制和丢行点名。
  • 两分钟验证:node scripts/pm/check-governed-merges.mjs --self-test 应 exit 0(799 条断言)。
  • 需要你做的:批准本 PR。达档复审 PASS 评论 6897531409,Head-sha 77b6b465ad41537d2fb1b5064b1273e319fc2cbe;批准后由席位落地。

席位意见:建议批准。一个残余请您知悉:GitHub 在关卡事件上不提供「经哪个 App 签发」(2026-11-15 实测,events 与 timeline 两个端点都是 null),所以审计卡只能按账号判断。席位会话若用审批人账号关卡,会被读成该审批人的裁决,与队列守卫的账号判定同一水平。本卡 N1/N7 未完(Part of #33814),待 #33765 落地后补读缺失的 head。

席位核对 · ACCEPT · head 77b6b465ad41537d2fb1b5064b1273e319fc2cbe · 2026-11-15T16:20Z

  • 形态: 3 files, .github/workflows/fleet-patrols.yml (job governed-merges-audit), scripts/pm/check-governed-merges.mjs (new audit-card region and its battery), scripts/check-platform-checklist-watchdog.mjs (header prose), inside the claim's surface. check-governed-merges --pr 33982: Tier H by content (a changed job that holds a write token); under the 3,000-line threshold.
  • 前提实测: the card's readings reproduced against the removed inline script, line against line (record 6896878561 ①). The S1 premise was measured by this seat on the timeline endpoint (performed_via_github_app null on every closed event of the last 40 closed issues) and by the reviewer on 300 issue events.
  • 复核: round 0 PASS 6896878561 (S1–S3 open); round 1 PASS 6897204057 on bdb2a307 (S2, S3 closed; S1 kept open); round 2 PASS 6897531409 on this head by the same reviewer, Served-tier: CONTRACT_REVIEW_TIER, S1 closed by wording, no must-fix, no should-fix.
  • 门禁 check-runs: 53 on this head: 37 success, 15 skipped, 0 failed; one PR-body guards re-run after the body edit was queued at review time.
  • 接受的偏差: the dev created the audit-card region (none existed); N1 and N7 left open as Part of, both failing toward an extra NOT MEASURED row; record nits not carried.
  • 范围外去向: stale.yml does not exempt the audit card's label → stale.yml: exempt the governed-merges-audit card, so a dead patrol's unruled audit card is not stale-closed with its carried BREACH rows #33993 (filed by this seat). N1/N7 stay on review follow-ups of PR #33766 #33814.
  • 落地: Tier H: draft, pm:awaiting-merge, both GOVERNED_APPROVERS requested; the seat lands after an authorised approval on the head.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 15, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 15, 2026 16:33
@os-zhuang
os-zhuang enabled auto-merge November 15, 2026 16:33
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 7a3b4cc Nov 15, 2026
59 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-gxa5jr branch November 15, 2026 17:03
@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants