Skip to content

Commit e424552

Browse files
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/landing-operations.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
- 转 ready/入队前跑 `check-governed-merges.mjs --pr N`,判定读全文 ⛔ 不 tail/head;四件套照 SKILL.md。
6363
- ⛔ 两层不由席位批准;清标即落地同受此闸,漏判会被队列守卫在 merge group 里拒收。
6464
- 挂 auto-merge 的同一动作里重测生成物漂移,⛔ 不复用更早的零;非零 ⇒ 按 A 的固定序。
65-
- ready + 全绿 ≠ 已入队:队列从不主动拉 PR,入队是显式动作。
6665
- 零 `enqueued` 事件按序查三条:① `mergeable_state` 是否 `dirty`。
6766
- ② enable-auto-merge 调用根本没落地,重发与效果验证序列见 `platform-readings.md`。
6867
- ③ PR 碰 `.github/workflows/**`:令牌常驻 `workflows: write`(裁决评论 6104822731),仍拒即授权漂移。
@@ -71,6 +70,7 @@
7170
- 每次合并后重拉一次车道盘点与预期状态对账,⛔ 不留给下轮巡检。
7271
- 取 open 卡清单对照预期 diff:预期之外从 open 消失的,就是被闭合关键词静默误关的卡。
7372
- 落地后再核一次落地判据本身:队列的合并同样走 os-regen,A 的静默吞并一样能发生。
73+
- 验收要 staging 读数:合并后经中继派 cloud `deploy-staging.yml` 一次,同合并仅一次,卡记运行号。
7474
- MERGED 不是终点:发版后义务见 `release-aftercare.md`。
7575
- PR 开出至 MERGED,每看一眼(唤醒/巡检/报告前)同读检查与 `mergeable_state`;`unknown` 即重读。
7676
- `dirty` ⇒ 当即合 `origin/main` 推新提交,⛔ 不等冲突通知;未见非 `dirty` ⛔ 不报无需你做。

‎scripts/pm/fleet-write/dispatch.mjs‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,14 @@
342342
* The Version Packages refresh is such a stroke — an actions file of
343343
* `[{ "op": "workflow_dispatch", "workflow": "release.yml", "ref": "main",
344344
* "inputs": { "refresh_version_pr": true } }]`, the one inputs object the op
345-
* table admits for that file (`WORKFLOW_DISPATCH_INPUTS`, `ops.mjs`): it
345+
* table admits for that file (`WORKFLOW_DISPATCH_BY_REPO`, `ops.mjs`): it
346346
* starts the bookkeeping lane alone, and its run is read back from
347347
* `release.yml`'s own run list the same way. Any other inputs are refused here
348-
* before anything is sent.
348+
* before anything is sent. cloud's staging deploy is the same stroke sent with
349+
* `--repo objectstack-ai/cloud` — `[{ "op": "workflow_dispatch", "workflow":
350+
* "deploy-staging.yml", "ref": "main", "inputs": { "apps": "affected" } }]` —
351+
* and its run is read back from CLOUD's run list, the stroke's own target; the
352+
* same file on any other repository is refused here.
349353
*
350354
* ## The no-run conformance — every sender, one answer
351355
*
@@ -2094,7 +2098,7 @@ const SELF_TEST_BATTERIES = Object.freeze({
20942098
'the wiring: the POST is paced and on the roster, the reads are not, the token never reaches the log': 5,
20952099
'the CLI: a dry run sends nothing, usage, the exit ladder, the session derived from the container, a route read behind a dead proxy refuses': 11,
20962100
'the no-run conformance: every sender — discovered from the source — answers an accepted dispatch with no run, or none completed, UNCONFIRMED (6) after ONE dispatch with ZERO direct writes, under auto and explicit dispatch alike; under direct its write is seen': 27,
2097-
"the started run: an action naming a workflow is read back as the newest workflow_dispatch run of that file created since the dispatch — the target repo's run list, read after the relay run completed and re-read within a bounded window; found is success naming id, url and actor; none in the window or an unreadable list is UNCONFIRMED (6) after ONE dispatch; a stroke naming no workflow reads none": 11,
2101+
"the started run: an action naming a workflow is read back as the newest workflow_dispatch run of that file created since the dispatch — the target repo's run list, read after the relay run completed and re-read within a bounded window; found is success naming id, url and actor; none in the window or an unreadable list is UNCONFIRMED (6) after ONE dispatch; a stroke naming no workflow reads none": 13,
20982102
"the release.yml refresh at the seat: the stroke packs with inputs refresh_version_pr true and travels in ONE dispatch; its started run is read back from release.yml's own run list; force, false, absent or any other input is refused before anything is sent, exit 2": 6,
20992103
"the batch gap at the seat: content creation read off the op table; a stroke at or above write-pace's threshold is batched through its last content-creating write and waited for exactly that much longer; a stroke whose pacing the relay job cannot hold is refused before anything is sent, naming the per-op doors; the job's timeout mirrors the workflow's": 13,
21002104
"the signature at the seat's door: a comment_edit or issue_patch body opens with the seat's signature line or the file is usage (2), nothing packed; generated, body-less and the other doors' ops are left alone": 13,
@@ -2794,6 +2798,15 @@ export async function selfTest() {
27942798
t('a run list that does not answer is UNVERIFIED (unread) naming the call, exit 6 — never success', [down.state, down.runs?.rows?.[0]?.cls, down.runs?.rows?.[0]?.why?.includes('HTTP 503'), exitForResult(down)], ['unverified', 'unread', true, EXIT_UNCONFIRMED]);
27952799
const comment = await drive(OK_RUN, { file: paceFile });
27962800
t('a stroke naming no workflow reads no run list: runs none, no such GET', [comment.runs?.state, comment.seen.some((s) => s.call.includes('/actions/workflows/'))], ['none', false]);
2801+
// Another repository's workflow: cloud's staging deploy is read back from CLOUD's run list, the stroke's own target.
2802+
const CLOUD = 'objectstack-ai/cloud';
2803+
const STAGING = { op: 'workflow_dispatch', workflow: 'deploy-staging.yml', ref: 'main', inputs: { apps: 'affected' } };
2804+
const CLOUD_RUNS = `GET /repos/${CLOUD}/actions/workflows/deploy-staging.yml/runs`;
2805+
const staged = packRequest({ repo: CLOUD, session: SESSION, actions: [STAGING], requestId: 'fw-test-1' });
2806+
const onCloud = await drive({ ...OK_RUN, store: { [CLOUD_RUNS]: { status: 200, json: { total_count: 1, workflow_runs: [wfRun(9201, 12_000, { html_url: `https://github.test/${CLOUD}/actions/runs/9201` })] } } } }, { stroke: staged.payload });
2807+
t("a cloud staging deploy packs, and its started run is read from CLOUD's deploy-staging.yml run list — the stroke's target, never the board's", [staged.ok, onCloud.state, onCloud.runs?.rows?.[0]?.run?.id, onCloud.seen.some((s) => s.call === CLOUD_RUNS), onCloud.seen.some((s) => s.call.startsWith(`GET /repos/${REPO}/actions/workflows/`))], [true, 'success', 9201, true, false]);
2808+
const misplaced = packRequest({ repo: REPO, session: SESSION, actions: [STAGING], requestId: 'fw-test-1' });
2809+
t('…and the packer refuses the same action on the board repository before anything is sent, naming the repository', [misplaced.ok, misplaced.errors.some((e) => e.includes('is not a workflow the relay starts on "objectstack-ai/objectstack"'))], [false, true]);
27972810
// The CLI, end to end: --json carries the started run, and the exit a seat reads.
27982811
writeFileSync(join(dir, 'start.json'), JSON.stringify([{ op: 'workflow_dispatch', workflow: FILE, ref: 'main' }]), 'utf8');
27992812
const cliStart = async (store) => {

‎scripts/pm/fleet-write/execute.mjs‎

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@
5252
* installation remedy `transferRemedy` spells, in the log and the summary.
5353
* A `workflow_dispatch` is one POST the platform answers 204 to with no body,
5454
* carrying the inputs the op table closes for that file and nothing else
55-
* (`WORKFLOW_DISPATCH_INPUTS`: none for the shard-timings refresh,
56-
* `refresh_version_pr: "true"` alone for `release.yml`, its bookkeeping lane)
55+
* on the stroke's own repository (`WORKFLOW_DISPATCH_BY_REPO`: none for the
56+
* shard-timings refresh, `refresh_version_pr: "true"` alone for `release.yml`,
57+
* its bookkeeping lane, `apps: "affected"` alone for cloud's
58+
* `deploy-staging.yml`)
5759
* — its row reads `accepted`; the run it started is read back by the SEAT
5860
* (`dispatch.mjs`), never here, because the answer carries no run id, and the
5961
* token that request spends `actions: write` on reaches that path and the
@@ -1999,6 +2001,7 @@ const SELF_TEST_BATTERIES = Object.freeze({
19992001
'the transfer: the sender gated on BOTH repositories, both node ids first, a pull or a moved card refused before the mutation, landing only on the target, the remedy on failure': 11,
20002002
'the workflow_dispatch: ONE POST to the dispatch endpoint of the allowlisted file with { ref: main } under the App token, a bodiless 204 lands as accepted, a 422 or 403 is a failed action, no other actions/* request leaves, no annotation': 7,
20012003
'the release.yml refresh: ONE POST to its dispatch endpoint carrying { ref: main, inputs: { refresh_version_pr: "true" } } under the App token, landing as accepted; force, false, absent, a string or any other input refused with ZERO requests, exit 2': 9,
2004+
'the cloud staging deploy: ONE POST to cloud\'s deploy-staging.yml dispatch endpoint carrying { ref: main, inputs: { apps: "affected" } } after the sender gate on cloud, landing as accepted; a 422 or 403 from cloud a FAILED action; a non-default input, another ref, a file cloud does not list, or the file on the wrong repository refused with ZERO requests, exit 2': 7,
20022005
"the batch gap on the runner: a stroke carrying DEFAULT_BATCH_THRESHOLD or more content-creating actions is announced as ONE rule ⑤ batch before its first write — on an injected clock every write through the last content-creating one leaves a full DEFAULT_BATCH_GAP_MS after the one before, and the pacing is exactly what the seat budgets; below the threshold, after the batch and on a landing stroke rule ①'s gap; a stroke the job cannot hold refused with ZERO requests; an announcement the log cannot record refused before the first write": 10,
20032006
// 29 → 30 as the follow-up left the draft open: three pr_create NEGATIVE pins (no read, no request, no assignee) replace the create-side runs.
20042007
// 30 → 36 with the workflows split read on the relay: the plan with a reading, a Tier S workflow pull requesting no one, an H reading,
@@ -2017,8 +2020,8 @@ const SELF_TEST_BATTERIES = Object.freeze({
20172020
// Raised 17 → 18 with the governed-review follow-up battery, 18 → 19 with the run_rerun_failed battery, 19 → 20 with the
20182021
// hierarchy link battery, 20 → 21 with the advisory rows' battery, 21 → 22 with advisory_read's, 22 → 23 with the mailbox
20192022
// branch delete's, 23 → 24 with the private-repository issue body's, 24 → 25 with advisory_list's, 25 → 26 with
2020-
// pr_enqueue_front's: one battery, one row.
2021-
const SELF_TEST_BATTERY_FLOOR = 26;
2023+
// pr_enqueue_front's, 26 → 27 with the cloud staging deploy's: one battery, one row.
2024+
const SELF_TEST_BATTERY_FLOOR = 27;
20222025
const UNATTRIBUTED_BATTERY = '(unattributed)';
20232026

20242027
const batteryCases = new Map();
@@ -2554,6 +2557,31 @@ export async function selfTest() {
25542557
t('⛔ the release entry\'s inputs on the shard-timings refresh — a file whose entry is null — are refused with zero requests, exit 2', [shard.exit, shard.seen.length], [EXIT_REFUSED, 0]);
25552558
}
25562559

2560+
// ── the cloud staging deploy ────────────────────────────────────────────
2561+
battery('the cloud staging deploy: ONE POST to cloud\'s deploy-staging.yml dispatch endpoint carrying { ref: main, inputs: { apps: "affected" } } after the sender gate on cloud, landing as accepted; a 422 or 403 from cloud a FAILED action; a non-default input, another ref, a file cloud does not list, or the file on the wrong repository refused with ZERO requests, exit 2');
2562+
{
2563+
const CLOUD = 'objectstack-ai/cloud';
2564+
const FILE = 'deploy-staging.yml';
2565+
const DISPATCHES = `POST /repos/${CLOUD}/actions/workflows/${FILE}/dispatches`;
2566+
const CLOUD_PERM = `GET /repos/${CLOUD}/collaborators/os-support-ai/permission`;
2567+
const onCloud = { [CLOUD_PERM]: allowed[PERM] };
2568+
const deploy = (extra = {}, repo = CLOUD) => ({ ...base([{ op: 'workflow_dispatch', workflow: FILE, ref: 'main', inputs: { apps: 'affected' }, ...extra }]), repo });
2569+
const ok = await run(deploy(), { ...onCloud, [DISPATCHES]: { status: 204, json: null } }, { file: paceFile });
2570+
t('the one write is the dispatch call on CLOUD\'s deploy-staging.yml with { ref: main, inputs: { apps: "affected" } }, exit 0', [ok.exit, writes(ok.seen).map((s) => [s.call, s.body])], [EXIT_OK, [[DISPATCHES, { ref: 'main', inputs: { apps: 'affected' } }]]]);
2571+
t('…under the App token, after the sender gate on cloud — the ONE repository the stroke names', [ok.seen.map((s) => s.call), ok.seen.every((s) => s.auth === `Bearer ${TOKEN}`)], [[CLOUD_PERM, DISPATCHES], true]);
2572+
t('…a bodiless 204 lands as accepted, its summary row naming cloud\'s dispatch endpoint, no other actions/* request and no annotation', [ok.rows[0]?.status, ok.rows[0]?.result, ok.summary.includes(`| 1 | \`workflow_dispatch\` | \`${DISPATCHES}\` | 204 | accepted (HTTP 204, no body) |`), ok.seen.filter((s) => s.call.includes('/actions/') && s.call !== DISPATCHES), ok.annotations], [204, 'accepted (HTTP 204, no body)', true, [], []], ok.summary);
2573+
const undeclared = await run(deploy(), { ...onCloud, [DISPATCHES]: { status: 422, json: { message: 'Unexpected inputs provided: ["apps"]' } } });
2574+
t('a 422 — cloud\'s file declaring no such input, the unverified reading wrong — is a FAILED action, exit 5, with the platform\'s sentence', [undeclared.exit, undeclared.rows[0]?.status, undeclared.rows[0]?.result.includes('Unexpected inputs')], [EXIT_ACTION_FAILED, 422, true]);
2575+
const noGrant = await run(deploy(), { ...onCloud, [DISPATCHES]: { status: 403, json: { message: 'Resource not accessible by integration' } } });
2576+
t('a 403 — the installation not covering cloud with actions write — is a FAILED action, exit 5', [noGrant.exit, noGrant.rows[0]?.result.includes('Resource not accessible by integration')], [EXIT_ACTION_FAILED, true]);
2577+
const refused = async (payload, needle) => {
2578+
const r = await run(payload, { ...allowed, ...onCloud, [DISPATCHES]: { status: 204, json: null } });
2579+
return [r.exit, r.seen.length, r.logs.some((l) => l.includes('REFUSED') && l.includes(needle))];
2580+
};
2581+
t('⛔ apps all, and another ref, are refused with zero requests, exit 2', [await refused(deploy({ inputs: { apps: 'all' } }), 'actions[0].inputs.apps must be "affected"'), await refused(deploy({ ref: 'develop' }), 'actions[0].ref must be one of "main"')], [[EXIT_REFUSED, 0, true], [EXIT_REFUSED, 0, true]]);
2582+
t('⛔ deploy-staging.yml on THIS repository, and release.yml\'s refresh on cloud, are refused with zero requests, exit 2 — the file judged against the stroke\'s own repository', [await refused(deploy({}, REPO), 'is not a workflow the relay starts on "objectstack-ai/objectstack"'), await refused(deploy({ workflow: 'release.yml', inputs: { refresh_version_pr: true } }), 'is not a workflow the relay starts on "objectstack-ai/cloud"')], [[EXIT_REFUSED, 0, true], [EXIT_REFUSED, 0, true]]);
2583+
}
2584+
25572585
// ── the failed-jobs re-run ──────────────────────────────────────────────
25582586
battery("the run_rerun_failed: the five fences judged HERE on the run and its pull, read immediately before ONE bodiless POST — the pull's current head by its own GET, never the run's embedded copy, and a run naming no pull refused by name; each refused with the POST not sent and accepted on the measured run; a run, pull, baseline or fence that fails is zero writes; the 201 confirmed only by reading attempt 2 back with its failed jobs queued or in progress, naming their job ids; attempt 2 never seen, a failed job completed, or a job list unread is FAILED; no annotation");
25592587
{

0 commit comments

Comments
 (0)