Skip to content

Commit efc5e0a

Browse files
feat(fleet-write): advisory_list, a sealed listing of the triage, draft and closed advisories (#31418)
<!-- claude-projects-attribution: {"github_login":"huangyiirene"} --> _Requested by **Irene** · [project thread](https://claude.ai/code/project/chan_01TJXtQ1tVD26ecLDZxFS67x?thread=cmsg_01TJXtQ1tVD26ecLDZxFS67xNHNPCFsBAMPQeQz2QgSw6j)_ Fixes #31368 ## 维护者速读 **需要你做的:** 无。本 PR 为 **Tier S**(`check-governed-merges.mjs --pr` 实测,命中 `.claude/**` 一条),仍欠契约审查(contract review)记录,通过后由席位落地。 点名问题(这一集合读权限是否也需要你的点名,如同 `advisory_read` 当初那样?)**已答复**。你在项目线程中(2026-11-08)说:「我希望安全席位不需要我插手可以自己读取问题处理修复」(gloss: "I want the security seat to read the issues and handle the fixes on its own, without my stepping in")。 做了什么:中继新增只读操作 `advisory_list`,列出本仓 `triage`/`draft`/`closed` 三态全部公告,每条只留五个字段,加密封给座位的一次性公钥;公开的运行里只写“成功”或“失败”。安全席章程的接收 ② 与巡查改为用这份列表比对台账。无工作流或 App 权限改动。 ## The row's contract - **Op:** `advisory_list`, `required: ['public_key']`, `optional: []`, `alone: true`. The caller passes no state, page, cursor or query. - **Path:** `GET /repos/{owner}/{repo}/security-advisories?state=<s>&per_page=100[&after=<cursor>]`, for `s` in `triage`, `draft`, `closed`, walked in that order. `ADVISORY_LIST_PAGE_PATH_SHAPE` is the only query shape the refused family admits. The bare collection is still reached by the draft's POST alone; any other query, verb or tail stays refused (`validate.mjs` pins the variants). - **Paging:** the platform's own cursor. `after` is taken only from exactly one `rel="next"` link whose origin is this API's, whose path is exactly this repository's collection, whose `state` equals the walk's and whose `after` matches `ADVISORY_LIST_CURSOR_SHAPE` (`[A-Za-z0-9+/=_-]`, 1–256 chars). Anything else is FAILED with nothing emitted. The cursor is never logged. Every page's Link is read; `rel` is matched case-insensitively (RFC 8288). A short page with no next link, or a full page with none, ends a state; a short page that still names a next page is FAILED. Hitting `ADVISORY_LIST_PAGE_CAP` (3 pages of 100 per state) is FAILED, never a truncated answer. A repeated id across pages is FAILED. - **Projection, before sealing:** exactly `ghsa_id`, `state`, `severity`, `created_at`, `updated_at` (`ADVISORY_LIST_FIELDS`). Plaintext is `{ count, advisories }`. Each page is fenced first: every item is an advisory in the asked state with a well-formed id, `severity` is one of `critical`/`high`/`medium`/`low` or null, and both dates are ISO-8601 strings. Anything else is FAILED with nothing emitted, and the sentence echoes no value. - **Cap (measured, binds first):** the plaintext is padded with trailing spaces to exactly 29,939 bytes, so every sealed listing is 40,000 characters in 10 notice parts whatever the count. Measured with fake items, that ceiling is **206 advisories at 144 bytes each (`critical` severity) up to 215 at 138 bytes (no severity)**. It binds long before the page cap (300 per state). One more advisory than fits is FAILED with nothing emitted. The self-test pins that zero, one and the largest count that fits seal to the same length and 10 parts, and that one more is refused. - **Fence:** sender gate `target-write`, the same as `advisory_read` by the maintainer's ruling, checked before the first GET (refused means `not sent`, zero requests). Token: stroke-scoped `repository-advisories: read` through the row's `grant`; the validator writes `permission_repository_advisories=read` for this stroke, the path the workflow already carries for `advisory_read`. No `.github/**` or App permission change. - **Sealing:** the same X25519 + HKDF-SHA256 + AES-256-GCM seal as `advisory_read`, to the action's one-time key. Associated data comes from a shared `advisorySealAad`: `advisory_read`'s bytes are unchanged (pinned byte for byte against the old spelling), and `advisory_list`'s binds request id, action index and `op=advisory_list`, so neither answer opens as the other. The seat opens it and prints it to stdout on `--reveal` alone; the trailing-space trim applies to `advisory_list`'s display only, and the open stays byte for byte. `advisory_read`'s `--reveal` path is untouched. - **Public surface:** no id, count, state, severity or cursor in any log line, step summary, row or annotation. The row says only that the listing landed (sealed) or failed, with a fixed sentence. ## Charter: before and after `.claude/skills/pm-dispatch/references/lanes/security.md` - L17 before: `- 接收 ②:无门铃的 \`triage\` 公告(外报或中继实测):经 \`advisory_read\` 读,座位贴记 \`received\`。` - L17 after: `- 接收 ②:列表比出的无台账编号(外报、无门铃或席空时建):记 \`received\`,经 \`advisory_read\` 读。` - L20 before: `- 云席列不了本仓公告,中继也拒裸集合:编号只来自维护者、门铃或中继实测。` - L20 after: `- 巡查:每轮中继 \`advisory_list\` 列 \`triage\`/\`draft\`/\`closed\` 比台账;缺行照接收 ②,状态不符即改。` L21 (`--reveal` stdout only) and L22 (opaque ledger) already cover the output and opacity rules and are unchanged. `security-findings.md` does not restate the rule and is untouched. ## Line readings - `.claude/skills/pm-dispatch/references/lanes/security.md`: 53 → 53, every line within the 120-byte budget. - `.claude/skills/pm-dispatch/references/security-findings.md`: 65 → 65 (unchanged). - `node scripts/pm/check-skill-line-ratchet.mjs`: exit 0. ## Batteries | Self-test | Before | After | Battery floor | |---|---|---|---| | `validate.mjs` | 340 cases / 17 batteries | 361 / 18 | 17 → 18 | | `execute.mjs` | 284 / 24 | 306 / 25 | 24 → 25 | | `dispatch.mjs` | 349 / 29 | 358 / 30 | 29 → 30 | Ablations, each run then restored: projection off, pad off, the read's AAD changed, any query admitted by the refused family, the cursor host check off, the short-page next check off, the field fence off, and case-sensitive `rel`. Each reds at least one battery. ## Other sites found (not edited) - `.github/workflows/fleet-write.yml`, the `permission-repository-advisories` mint comment: it names `advisory_read` as the one read-only consumer of this input. After this PR `advisory_list` shares it, so the comment is incomplete. Outside this surface; the seat will file it. - `.claude/skills/pm-dispatch/references/rest-channel.md` L50: lists `advisory_create` 等 and `advisory_read`. It is a "等" list, not an enumeration, so it is not stale. Not edited. ## Notes - If dispatch-gates mandates a contract-review tier, that mandate is waived by the maintainer's standing order in this project (2026-11-03). - The new op has not been run against the live repository: the relay workflow runs from `main`, and acceptance is measured after merge. - Tests use obviously fake ids built the way the existing `advisory_read` batteries build theirs. No advisory content appears in this PR. - Changeset: `skip-changeset` (repo tooling only). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01J8VVAnrDeFPtUpYSMR9V1V <!-- signed: domain:skills#3 · huangyiirene · session_01J8VVAj7CvjkGXvgXzd6RZ7 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3aa0b42 commit efc5e0a

5 files changed

Lines changed: 858 additions & 60 deletions

File tree

‎.claude/skills/pm-dispatch/references/lanes/security.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
## 接收与台账
1515

1616
- 接收 ①:发现者 `Notify: security · GHSA-ID`(私有仓 `OWNER/REPO#N`)门铃,私卡已由其经中继建好。
17-
- 接收 ②:无门铃的 `triage` 公告(外报或中继实测):经 `advisory_read` 读,座位贴记 `received`。
17+
- 接收 ②:列表比出的无台账编号(外报、无门铃或席空时建):记 `received`,经 `advisory_read` 读。
1818
- 判定:发现 ⇒ 中继 `advisory_state` 置 `draft` 走派修;非发现 ⇒ 置 `closed`,台账记非发现。
1919
- 中继拒或本席空缺照第 3、9 节。
20-
- 云席列不了本仓公告,中继也拒裸集合:编号只来自维护者、门铃或中继实测。
20+
- 巡查:每轮中继 `advisory_list` 列 `triage`/`draft`/`closed` 比台账;缺行照接收 ②,状态不符即改。
2121
- 读出的公告明文只印本席进程 stdout(`--reveal`),⛔ 不进文件、日志或后台任务输出。
2222
- 台账住座位贴,一份一行:不透明编号 · 会话 · 状态;⛔ 无细节;修复的认领只记台账。
2323
- 状态词表:`received` → `fixing` → `merged` → `closed`;挑中发布再 `awaiting publish` → `published`。

0 commit comments

Comments
 (0)