Repository navigation
Commit e424552
feat(pm): the relay starts cloud's deploy-staging.yml on main with apps affected alone, its workflow table keyed by repository (#32494)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgBXNh9zsBcd9UVZmKY1ZasM)_
domain:skills#3 · os-bill · session_01Utp6CaqHXh17Qc3C7MRAQw
## 维护者速读
- 改了什么:中继的 `workflow_dispatch` 白名单改为按「仓库 + 文件」匹配,并给 cloud 仓加一行
`deploy-staging.yml`,输入封闭为 `apps: affected`、只在 `main` 上;pm-dispatch
加一条:卡的验收要 staging 读数时,合并后经中继触发一次、同一合并只一次、卡上记运行编号。
- 为什么改:cloud 的 staging 现在只能手动部署,席位合并后要上 staging
验收时每次都得请你跑一次;另外原白名单只按文件名匹配、不看仓库,同名文件在别的仓上也会被放行,这次一并封住。
- 风险与回滚:只放开 staging(生产只从 `v*` 标签重建,不经此路);白名单外的文件、非 `affected` 的输入、非
`main` 的 ref、错误的仓库都在发送前被拒、零写入;objectstack 原有两行行为不变。cloud
文件的输入名与默认值本会话读不到,按卡面事实写成,标为未核实:若不符,平台回 422、什么都不会启动。回滚即还原本 PR。
- 先看:`scripts/pm/fleet-write/ops.mjs` 的 `WORKFLOW_DISPATCH_BY_REPO`
与新头注节;`scripts/pm/fleet-write/validate.mjs` 的 `validateAction`
里按仓库判文件的那段;`landing-operations.md` 新增的一行。
- 两分钟验证:`node scripts/pm/fleet-write/validate.mjs --self-test && node
scripts/pm/fleet-write/execute.mjs --self-test`,预期 395 例 / 20 组、341 例 /
27 组全过。
- 需要你做的:审阅并合并(分诊定为 Tier H:它放宽了席位经中继能触发的范围);合并前请确认 objectstack-fleet App
的仓库授权覆盖 cloud。
Fixes #32409
Clause-②: no
Metadata-protocol: none
Skills-docs: none — `git grep -n -i -c -E
"WORKFLOW_DISPATCH|deploy-staging|workflow_dispatch" -- 'skills/**'
'content/docs/**'` has no hit (exit 1)
## What changes
The relay's `workflow_dispatch` row judged `workflow` against one list
of file names with no repository, and built the request body from that
list for whatever repository the stroke named. Two consequences: a cloud
workflow could not be listed without also becoming a name every
repository answered to, and a name this repository lists (`release.yml`,
`shard-timings-refresh.yml`) was already accepted on a stroke naming any
other repository in the organization.
- `ops.mjs`: the closed table is now keyed by repository,
`WORKFLOW_DISPATCH_BY_REPO` — `objectstack-ai/objectstack` →
`WORKFLOW_DISPATCH_INPUTS` (unchanged: the shard-timings refresh with no
inputs, `release.yml` with `refresh_version_pr: true`),
`objectstack-ai/cloud` → `CLOUD_WORKFLOW_DISPATCH_INPUTS`
(`deploy-staging.yml` with `apps: 'affected'`).
`workflowDispatchEntry(repo, file)` reads it; the row's `requests`
builds the body from the stroke's own repository's entry.
`WORKFLOW_DISPATCH_ALLOWLIST` (the `workflow` field enum) is every file
any repository lists. A new header section records the cloud entry, its
provenance (the account owner's 「同意立卡」) and that its reading is
unverified.
- `validate.mjs`: `validateAction(action, index, repo)` judges an
enum-admitted `workflow` against the stroke's repository: a file that
repository does not list is refused by name (naming what it does list,
or that it lists nothing), and only then are the inputs judged against
that repository's entry. The `inputs` field kind admits a boolean or a
string scalar; which one an input takes is its entry's, so `"true"` on
`release.yml` is still refused once, with the same sentence as before.
- `execute.mjs`, `dispatch.mjs`: docblocks name the per-repository
table; no executor or read-back code changed. The token is unchanged in
kind: a cloud stroke names `repo: objectstack-ai/cloud`, so it is minted
for that ONE repository with `actions: write`, and `transfer` stays the
only row that reaches a second repository. `fleet-write.yml` is not
touched.
- `landing-operations.md`: one line (when a seat may send it — staging
reading needed for acceptance, after the merge, once per merge, run
number on the card), paid by cutting 「ready + 全绿 ≠ 已入队:队列从不主动拉
PR,入队是显式动作。」, whose content stays at home in the same file's 「绿即落地评论与
`pr_ready`+`automerge_enable` 一笔中继」 and 「零 `enqueued` 事件按序查三条」 lines and
in AGENTS.md §7 (arm, then let the queue merge).
## Tests
- `validate.mjs --self-test`: new battery `the workflow table keyed by
repository …` (18 cases, floor 19 → 20 batteries): the table and its
roster membership; no name listed twice and no `deploy-staging.yml` in
this repository; the cloud deploy accepted on cloud, its one request
`POST
/repos/objectstack-ai/cloud/actions/workflows/deploy-staging.yml/dispatches`
with `{ ref: main, inputs: { apps: "affected" } }`, minted for cloud
alone with `actions: write`; refused before dispatch: `apps` `all` /
`web,api` / empty, absent inputs, an extra input, `apps: true`, refs
`develop` / `staging` / `refs/heads/main`, `deploy-cloud-prod.yml` and a
path, `deploy-staging.yml` on this repository and on objectui, and
`release.yml` / `shard-timings-refresh.yml` on cloud and objectui; this
repository's two entries accepted with the bodies they sent before.
Existing pins in the `workflow_dispatch` row and `release.yml` batteries
moved to the per-repository table (the on-disk checks now read this
repository's entries; cloud's file is not on disk here).
- `execute.mjs --self-test`: new battery `the cloud staging deploy …` (7
cases, floor 26 → 27): one POST to cloud's dispatch endpoint after the
sender gate on cloud, 204 accepted; a 422 (undeclared input) and a 403
(no grant) each a FAILED action; `apps: all`, ref `develop`, the file on
this repository and `release.yml` on cloud each refused with zero
requests, exit 2.
- `dispatch.mjs --self-test`: the started-run battery (pin 11 → 13): the
cloud stroke packs and its run is read back from CLOUD's run list, never
the board's; the same action on this repository is refused by the
packer.
## Acceptance notes
- READING UNVERIFIED: this session cannot read `objectstack-ai/cloud`
(access denied), and no cloud seat mailbox is open on this repository to
knock with `Request: cloud-confirm`, so the input name `apps` and
default `affected` are the card's stated facts. The first stroke's
read-back is the measurement; a wrong name answers 422 and starts
nothing.
- NOT MEASURED: whether the objectstack-fleet App's installation covers
cloud. App permissions are installation-wide and `actions: write` is
already minted for objectstack dispatches; repository coverage of cloud
is a setting no file here can read. A gap fails the mint or answers 403,
zero runs.
- Tier: `check-governed-merges.mjs --branch HEAD` reads the path as Tier
S (`.claude/**`); triage 6792783605 grades the change Tier H because it
widens what a seat can dispatch — the maintainer merges.
- No changeset: repo scripts and an agent reference file, nothing any
package's `files` ships (`skip-changeset`).
## Verification
Head `c672fb3a` (fix `3e2c2e76` merged with `origin/main` `1af82539`; no
commit between the base `7d13a333` and it touched `scripts/pm/**`,
`.claude/skills/pm-dispatch/**` or `fleet-write.yml`).
<details><summary>Self-tests on the final head</summary>
- `validate.mjs --self-test`: 395 cases pass across 20 batteries (main:
377 across 19).
- `execute.mjs --self-test`: 341 cases pass across 27 batteries (main:
334 across 26).
- `dispatch.mjs --self-test`: 360 cases pass across 30 batteries (main:
358). The started-run pin 13 is exact: raised to 14 in a probe, the
self-test exits 1.
</details>
<details><summary>Ablation (one-shot, red, then restored)</summary>
- Mutation through `scripts/ablation-replace.mjs` on `validate.mjs`: the
repository lookup `const table = … spec.closedInputs[repo] …` replaced
by the union of every repository's entries, i.e. the file name judged
alone as before this PR (anchor 1 → 0, blob `3c2665ace8bd` →
`71a0cca4775a`).
- Red: validate 3 of 395 failed (deploy-staging.yml on this repository,
on objectui, and the release / shard-timings refresh on cloud and
objectui all accepted); execute 1 of 341 (the two wrong-repository
strokes reached the platform: exit 5 with 2 requests sent instead of
exit 2 with 0, which is the hole as it stood); dispatch 1 of 360 (the
packer accepted the misplaced action).
- Restored by the tool: blob equal to HEAD (`3c2665ace8bd`), `git diff
HEAD` empty, marker count 0.
- A first attempt replaced the whole `if` with `if (false)`; that
crashed `closedInputsErrors` on a null table instead of reading red, so
it is not counted.
</details>
<details><summary>Gates</summary>
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` at `c672fb3a`: 46 commands, each run with
its exit code captured before any pipe: all 46 exit 0. `--ran`: 46
derived, 46 run, 0 NOT-MEASURED (a derived zero, every line carries its
exit code). `pnpm --filter @objectstack/lint run
check:doc-formula-expressions` exited 3 (prerequisite: unbuilt
formula/lint) on the first pass; after `turbo run build
--filter=@objectstack/formula --filter=@objectstack/lint` under the
verify lock it exits 0.
- `pnpm exec eslint --no-inline-config` on the four scripts: exit 0. The
repo-wide `pnpm lint` is CI's.
- `pnpm check:pm-skill-ratchet`: `landing-operations.md` 107 lines,
ceiling 107, headroom 0; the new bullet is 120 bytes. `pnpm
check:pm-skill-id-lint`: clean.
- `check-governed-merges.mjs --branch HEAD`: 1 of 5 paths governed (Tier
S by path), 267 changed lines. Control-byte scan of the five files: no
hit.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6CaFdi87fntDMLmzrjV)_
<!-- signed: domain:skills#3 · os-bill ·
session_01Utp6CaqHXh17Qc3C7MRAQw -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent c6230f4 commit e424552
5 files changed
Lines changed: 218 additions & 49 deletions
File tree
- .claude/skills/pm-dispatch/references
- scripts/pm/fleet-write
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
| |||
71 | 70 | | |
72 | 71 | | |
73 | 72 | | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
345 | | - | |
| 345 | + | |
346 | 346 | | |
347 | 347 | | |
348 | | - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
349 | 353 | | |
350 | 354 | | |
351 | 355 | | |
| |||
2094 | 2098 | | |
2095 | 2099 | | |
2096 | 2100 | | |
2097 | | - | |
| 2101 | + | |
2098 | 2102 | | |
2099 | 2103 | | |
2100 | 2104 | | |
| |||
2794 | 2798 | | |
2795 | 2799 | | |
2796 | 2800 | | |
| 2801 | + | |
| 2802 | + | |
| 2803 | + | |
| 2804 | + | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
2797 | 2810 | | |
2798 | 2811 | | |
2799 | 2812 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
1999 | 2001 | | |
2000 | 2002 | | |
2001 | 2003 | | |
| 2004 | + | |
2002 | 2005 | | |
2003 | 2006 | | |
2004 | 2007 | | |
| |||
2017 | 2020 | | |
2018 | 2021 | | |
2019 | 2022 | | |
2020 | | - | |
2021 | | - | |
| 2023 | + | |
| 2024 | + | |
2022 | 2025 | | |
2023 | 2026 | | |
2024 | 2027 | | |
| |||
2554 | 2557 | | |
2555 | 2558 | | |
2556 | 2559 | | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
| 2566 | + | |
| 2567 | + | |
| 2568 | + | |
| 2569 | + | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
2557 | 2585 | | |
2558 | 2586 | | |
2559 | 2587 | | |
| |||
0 commit comments