Repository navigation
Commit efc5e0a
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
- scripts/pm/fleet-write
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
0 commit comments