Skip to content

Commit b617675

Browse files
feat(fleet-write): the relay replaces an unpublished advisory's summary and description, sealed like a note (#36672)
Fixes #36662 Clause-②: no Metadata-protocol: none Rule-change: yes ## 维护者速读 - 用户无感:安全席发布公告前,现在可以经中继把未发布公告的标题摘要和正文整段换成对外文本,不用再到网页逐份手改。 - 属于安全公告发布流程,替安全席解决「中继改不了正文」这件事。 - 出错时这一步失败并停下,已发布或已撤回的公告一律不碰;新正文在载荷与日志里都不出现,改错可再换一次。 - 发布也多了一道把关(改了已有的 `advisory_state`):正文里只要还有一行席位签名(也就是内部备注),或者正文不是文本,发布就被拒绝。被拒时只读一次、不写任何东西,只报出备注的行数,不带任何正文。这道关只能证明正文里没有席位备注,不能证明正文已经替换过;它的检查时点是发布前那唯一一次读取。 - 要你做:审阅并批准落地(本 PR 改了车队规则文件,需你本人批准)。 ## What changes A new relay row, `advisory_rewrite`, replaces the `summary`, the `description`, or both, of a repository security advisory that is not published. It rides the `advisory_note` machinery end to end; no second sealing path exists. - **Seat (`dispatch.mjs`).** The actions file names `summary_file` and/or `description_file`. Each path goes through `advisoryNoteFilePlace` (outside every git repository, at its real path) before it is read. `advisoryRewriteCompose` trims, adds no signature line or stamp (this is the public text) and spells the fields as one JSON object. `armAdvisoryNotes` then seals it with the note's `sealAdvisoryNote`, the committed relay key and a fresh one-time digest key. The payload carries `ghsa_id` and `sealed_note` alone. - **Associated data (`ops.mjs`).** `advisorySealAad` gains the rewrite's own prefix and op, so a note's seal never opens as a rewrite and a rewrite's never as a note. - **Executor (`execute.mjs`, `advisoryRewriteAction`).** It follows the note's order: the key, then a fenced GET (`ADVISORY_REWRITE_FENCES` = the note's fences with states `triage`/`draft`/`closed`, plus a summary that is text). Then the open, the text judged again (`advisoryRewriteFailure`), the mask, and a second fenced GET (a summary or description changed since the first is refused). Then ONE PATCH of exactly the fields sealed, and the read-back (`advisoryRewriteReadBack`): the PATCH answer, then a GET after it, holding each field sent byte for byte and the field not sent as read. A mismatch is a FAILED action carrying `ADVISORY_REWRITE_NOT_RESENT`. - **Read-back digest.** The run's ONE notice is the note's spelling with op `advisory_rewrite`. Its keyed digest is taken over the text the advisory STORES after the PATCH (`advisoryRewriteStoredDigest`), not over the text opened. `confirmRunAdvisoryNotes` holds it to the digest the seat sealed, so a seat-side match reads back the stored bytes. - **Validator (`validate.mjs`).** The stroke mark is now derived (`SEALED_TO_RELAY_OPS`, the rows requiring `sealed_note`), so a rewrite stroke writes `advisory_note=yes`. The workflow's existing line therefore hands it the relay key with no workflow change. The row is `alone: true` and spends `repository-advisories: write`, the note's grant and gate. - **Nothing printed.** Refusals name keys, states, fields and byte counts; the landed row prints the id, the state, per-field byte counts and the keyed digest. - **Docs.** The fleet-write headers (`ops.mjs`, a new section "The one row that REPLACES an advisory's text"; `execute.mjs`; `dispatch.mjs`, with its usage text). The security lane's publish step (呈维护者) now names the order `advisory_rewrite` → `advisory_versions` → `advisory_state`. `security-findings.md` §3 names the row and the order. **Which states the platform takes the PATCH in (still a reading; the first live rewrite is owed by the security seat after merge) — source: GitHub's REST description, not a live advisory.** Operation `security-advisories/update-repository-advisory` in `github/rest-api-description` (`descriptions/api.github.com/api.github.com.json`, read 2026-11-23) states no state restriction for `summary` (maxLength 1024) or `description` (maxLength 65535). Its one documented refusal is a state move, `published` → `draft` (422, "Invalid state transition"). Nothing was measured against a real advisory: per the order, no advisory of this repository was read, created or PATCHed from this session. The fence is the relay's and narrower than the platform's: `triage`, `draft`, `closed` (the note's states). The first live rewrite on a draft the security seat chooses after merge confirms it; `triage` and `closed` stay documentation readings until a rewrite lands in each. This is stated in the row's doc. **Publish fence (changes an existing row, `advisory_state` → `published`).** A publish is REFUSED while the description carries a seat signature line, matched per line after trimming and CRLF-tolerant against a lane-agnostic superset of `SEAT_SIGNATURE_LINE`. It is also refused when the description is neither text nor null. The fence is judged on the row's own GET just before the PATCH. A refusal is one GET and zero writes, a fixed sentence and a count, and no text. The fence proves the description holds no seat note; it does not prove a rewrite happened. Its window is that one read (stated in both headers). The lane's publish step states it as 「正文含席位签名行即拒」. **Governed surfaces.** The diff touches `.claude/skills/pm-dispatch/references/lanes/security.md` and `.claude/skills/pm-dispatch/references/security-findings.md` (`.claude/**`). `Rule-change: yes`. Two rule lines in the lane's publish step change: the order (`advisory_rewrite` → `advisory_versions` → `advisory_state`) and 「正文含席位签名行即拒」. Because the publish order the security seat follows gains a step, so this PR is Tier H and lands only on the maintainer's approval. `scripts/pm/fleet-write/**` is not a governed path. The workflow file is untouched. **Byte ratchet.** Both doc files were at their ceilings with zero headroom, and no ruling comment orders text into them. The new rule is paid for by deletion inside each file (`check-skill-line-ratchet` green: 3933/3934 and 4193/4194). Every deletion is a reason, an example or a restatement whose rule stands elsewhere: - dropped 「一步即成」; - dropped 「(席位账号读被拒)」; - dropped 「(cloud 即 cloud 车道)」; - dropped the lane doc's restated 「文件置 git 仓外」 (§3 keeps it); - dropped the state list after `advisory_list`, which lists exactly those states by construction; - dropped 「本文是本车道岗位说明,」, a description of the file; - small rewordings (「只有」→「仅」, 「自己的」→「其」). ## Tests All local, on head `f1418cd9`: | Self-test | Before (BASE `9348f02b`) | After | |:--|:--|:--| | `node scripts/pm/fleet-write/validate.mjs --self-test` | 436 cases / 22 batteries | **453 / 23** | | `node scripts/pm/fleet-write/execute.mjs --self-test` | 443 / 30 | **460 / 31** | | `node scripts/pm/fleet-write/dispatch.mjs --self-test` | 418 / 33 | **430 / 34** | Each file's battery floor is raised by one. The new batteries cover what the card lists, plus the publish fence (each edited seat-note head, CRLF, padding, a signature at the top and the bottom, a non-text description, and public text with a stamp-shaped line that is not counted): - a refusal for a published advisory (validator fence; executor: ONE GET, zero writes); - a refusal for an empty description (validator judge, executor re-judge after the open, seat compose); - a refusal when a text file sits inside a repository (this checkout, another clone, one of two files inside); - the round-trip digest check (validator unit; executor notice parsed by the seat's parser; seat end to end against the real executor, plus a foreign seal's digest UNVERIFIED, exit 6); - a payload carrying no plaintext (validator and seat, as text and in the decoded seal); - a marker sweep over every executor run: no byte of the new or old text on any log, row, summary, annotation or pace line. Existing pins that enumerate the advisory rows were extended: the alone list, the repository-advisories spenders, the security-advisories request list, the rows table, and the per-op fixture tables. <details><summary>Mutation proof — each new assertion can fail (5 legs, via scripts/ablation-replace.mjs, each restored with git checkout HEAD and git diff HEAD empty)</summary> | Mutation | Case that went red | Self-test | |:--|:--|:--| | `advisoryRewriteReadBack` skips the field compare | "the read-back: exactly the fields sent land…" | validate 1 of 450 | | same | "the read-back: a PATCH answer whose description is not the one sent is NOT STORED…" | execute 1 of 458 | | `ADVISORY_REWRITE_STATES` admits `published` | "a PUBLISHED advisory, a withdrawn one…" | execute 1 of 458 | | the PATCH body gains a `state` key | "REPLACE: the PATCH carries { summary, description } and nothing else…" and "a description alone…" | execute 2 of 458 | | the seat skips the placement check for a rewrite | "a text file inside a git repository is REFUSED before it is read…" | dispatch 1 of 430 | </details> ## Acceptance notes - `.github/workflows/fleet-write.yml` comments (header and the execute step's env comment) still say the note key reaches the execute step "only for an `advisory_note`" stroke. The behaviour is unchanged and correct: the line keys on the validator's `advisory_note=yes`, which a rewrite stroke now also writes. The comment is stale, but the workflow is outside this card's file surface and is a Tier H path, so it is left alone. carrier: #36684. - `ops.mjs`' grant paragraph said "the seven rows spending" repository-advisories before this change, which was already one short (`advisory_note`). It now names all nine. ## Verification Read first, by risk: 1. `scripts/pm/fleet-write/execute.mjs` — `advisoryRewriteAction`: the fence states, the second read, the PATCH body, the read-back and the stored-text digest. 2. `scripts/pm/fleet-write/dispatch.mjs` — `armAdvisoryNotes`, the rewrite branch: the placement check before any read, and the file keys removed from the action. 3. `scripts/pm/fleet-write/ops.mjs` — `advisorySealAad` (the rewrite's own associated data) and `advisoryRewriteFailure`. Two-minute check: `node scripts/pm/fleet-write/execute.mjs --self-test` prints `460 cases pass across 31 batteries`, among them the `advisory_rewrite` battery. <details><summary>Local gates — the derived list (node scripts/pm/dispatch-gates.mjs --commands, 70 families) on head f1418cd</summary> - `node scripts/pm/dispatch-gates.mjs --ran` with exit codes recorded: **70 derived, 68 run, 2 NOT-MEASURED, 0 UNRUN**, exit 0. - 68 exited 0, among them `pnpm check:pm-fleet-write-validate`, `-execute`, `-dispatch`, `pnpm check:pm-skill-ratchet`, `pnpm check:nul-bytes`, `pnpm check:pm-governed-prose`, `pnpm check:pm-skill-id-lint`, `pnpm check:doc-authoring` and `pnpm check:pm-dispatch-gates` (2264 cases, fast tier). - NOT MEASURED, exit 3 (`PREREQUISITE NOT MET`): `pnpm --filter @objectstack/lint run check:doc-formula-expressions` (needs `@objectstack/formula` built) and `pnpm check:i18n-coverage` (needs the CLI built). This diff touches no package; both families belong to CI. - Repo-wide scans (`pnpm lint`, the full farm) are CI's. </details> Contract review: PASS at `f1418cd9` (security seat, comment 7101303609). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017xRBcW9L8Noz9BxEwjwiov <!-- signed: security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 85dde2d commit b617675

6 files changed

Lines changed: 975 additions & 99 deletions

File tree

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
# 车道章程:安全席(security)
22

3-
见 seat-lifecycle.md;本文是本车道岗位说明,现值状态恒在座位贴,⛔ 不迁入本文。
3+
见 seat-lifecycle.md;现值状态恒在座位贴,⛔ 不迁入本文。
44
永不公开的规则只住 `../security-findings.md`(下文「第 N 节」皆指它),本文只指向、⛔ 不复述。
55
本文与座位贴不载任何发现、编号、路径、对象名或机制。
66

77
## 座位
88

99
- 席位 `security#N`,首席 `security#1`,只管本仓公告;签名、座位贴、坐席与收班同他席。
1010
- 无 `domain:security` 标签、无 `pm:queue`、无文件面:私卡照第 3、9 节,修复落在归属包。
11-
- 坐席者 = 能读写本仓安全公告的账号(管理员或安全经理)的会话;读不了公告 ⛔ 不坐。
11+
- 坐席者 = 能读写本仓安全公告的账号(管理员或安全经理)的会话;读不了 ⛔ 不坐。
1212
- 公告的读、建与写只照第 3 节;中继拒或本席空缺照第 3、9 节。
1313

1414
## 接收与台账
1515

1616
- 接收 ①:发现者 `Notify: security · GHSA-ID` 门铃,公告已由其经中继建好;私有仓卡不经本席。
1717
- 接收 ②:列表比出的无台账编号(外报、无门铃或席空时建):记 `received`,经 `advisory_read` 读。
1818
- 判定:发现 ⇒ 中继 `advisory_state` 置 `draft` 走派修;非发现 ⇒ 置 `closed`,台账记非发现。
19-
- 巡查:每轮中继 `advisory_list` 列 `triage`/`draft`/`closed` 比台账;缺行照接收 ②,状态不符即改。
19+
- 巡查:每轮中继 `advisory_list` 比台账;缺行照接收 ②,状态不符即改。
2020
- 接收与每轮巡查把 `draft` 公告只按同根因机制(同缺失检查或同门族)归组,限同归属包内。
21-
- 读出的公告明文只印本席进程 stdout(`--reveal`),⛔ 不进文件、日志或后台任务输出。
22-
- 分析经中继 `advisory_note` 追加进公告正文:文件置 git 仓外,首行签名,有裁定即引其记录。
21+
- 读出的公告明文只印本席进程 stdout(`--reveal`),⛔ 不进文件、日志或后台输出。
22+
- 分析经中继 `advisory_note` 追加进公告正文:首行签名,有裁定即引其记录。
2323
- 一组一份牵头公告,孤例自成一组;分析一组一份追加进牵头,其余成员各留一行指向它。
2424
- 台账住座位贴,一份一行:不透明编号 · 会话 · 状态;⛔ 无细节;修复的认领只记台账。
2525
- 台账行加不透明组标(`G1`、`G2`…),⛔ 不用机制词;成员状态只随载其修复的 PR 合入前移。
@@ -36,20 +36,20 @@
3636

3737
## 呈维护者
3838

39-
- 任何问题呈维护者前,先由隔离 agent 复核其分析,档位照 `../execution-duties.md` 定档节。
39+
- 任何问题呈维护者前,先经隔离 agent 复核,档位照 `../execution-duties.md` 定档节。
4040
- 复核者只拿分析与证据,⛔ 不拿本席结论;核四轴、选项无漏、推荐成立、证据为真。
4141
- 问题随附复核判词与全部异议。
4242
- 每次发版前呈发布与否清单:上次发版后 `closed` 的公告,高危、中危在前;先经上条复核。
4343
- 清单按组列,成员列在牵头下。
4444
- 修复在版本 X 内,只当其合并提交是 X 打标提交的祖先(`git merge-base --is-ancestor`)。
4545
- ⛔ 合并时刻早于打标时刻不是证据。
46-
- 维护者批准即 `awaiting publish`;本席经中继发布即 `published`,照第 3 节;⛔ 不发清单外的。
46+
- 维护者批准即 `awaiting publish`;本席经中继依序 `advisory_rewrite` 换正文、`advisory_versions`、`advisory_state` 发布即 `published`,照第 3 节;正文含席位签名行即拒;⛔ 不发清单外的。
4747

4848
## 收口(逐对象)
4949

5050
- PR 由合并队列合入;本席确认 MERGED 后照 `../landing-operations.md` 收口其卡。
5151
- 公告:修复合入即经中继 `advisory_state` 置 `closed` 并记座位贴,⛔ 不逐份请示。
52-
- 云卡:工作落地即由本席归档;子代理自行结束并删自己的 worktree。
52+
- 云卡:工作落地即由本席归档;子代理自行结束并删其 worktree。
5353

5454
## 误公开的卡(第 7 节)
5555

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
## 3. 私卡:公开仓是安全公告(选 B),私有仓是 `security` issue
1717

1818
- 分辨看受影响仓的 `private` 标志,立私卡时经 API 现读,⛔ 不凭记忆。
19-
- 公开仓私卡 = 受影响仓上未发布的安全公告,只有管理员、安全经理与受邀协作者可见。
20-
- 首选中继 `advisory_create` 建草稿公告,一步即成,建时不指定协作者。
21-
- 读公告只走中继 `advisory_read`(席位账号读被拒):一次性密钥只在席位进程,只回密文。
22-
- 追加公告正文只走中继 `advisory_note`:文件置 git 仓外,就地封钥,⛔ 明文不进载荷与日志。
19+
- 公开仓私卡 = 受影响仓未发布的安全公告,仅管理员、安全经理与受邀协作者可见。
20+
- 首选中继 `advisory_create` 建草稿公告,建时不指定协作者。
21+
- 读公告只走中继 `advisory_read`:一次性密钥只在席位进程,只回密文。
22+
- 追加正文只走中继 `advisory_note`,换未发布公告的摘要与正文只走 `advisory_rewrite`:文件置 git 仓外,就地封钥,⛔ 明文不进载荷与日志。
2323
- `advisory_report` 与 `advisory_create` 同铸公告写权,无此权的仓两者皆拒;私报另有账号日限。
24-
- 只发维护者为该版批准的清单:经中继先定版本再发布;运行编号记座位贴,⛔ 无正文。
25-
- 两操作皆被拒 ⇒ 会话专递(选 A):机制只在会话里交维护者,由其建草稿,⛔ 不换账号重发。
24+
- 只发维护者为该版批准的清单:经中继换正文、定版本、再发布;运行编号记座位贴,⛔ 无正文。
25+
- 两操作皆被拒 ⇒ 会话专递(选 A):机制只在会话交维护者,由其建草稿,⛔ 不换账号重发。
2626
- 回退时座位贴只写不透明编号与状态,⛔ 无细节。
2727
- 公开仓修复只由 `security#1` 席以无卡派发令照章程按组派 `os-dev`;机制只进派发令与公告。
2828
- 用到公告的临时私有 fork ⇒ 修复从该 fork 落地。
2929
- 私有仓私卡 = 该仓带 `security` 标签的普通 issue,经中继 `issue_create` 立,机制写在其中。
30-
- 私有仓卡归该仓车道(cloud 即 cloud 车道),照其规则派修、L1/L2 审核、落地;第 2、6 节照旧。
30+
- 私有仓卡归该仓车道,照其规则派修、L1/L2 审核、落地;第 2、6 节照旧。
3131

3232
## 4. 跨仓发现者(应用仓量框架、cloud 席位)
3333

0 commit comments

Comments
 (0)