Repository navigation
Commit 8b53cc8
fix(service-automation): a run summary node row carries its steps warnings, so a refused notify channel shows in the trigger response (#33438)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DMscMg6AKHasj3ZXEDorLPH)_
Fixes #33341
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: none — the added member is a field of the run summary the
platform answers; no metadata author writes it, and no skill teaches the
summary's node rows
## 维护者速读
- 改了什么:流程运行摘要 `summary.nodes[]`
的每个节点行,现在会带上该节点步骤产生的告警(`warnings`,字符串数组);spec 的
`FlowRunNodeSummarySchema` 同步声明这个可选字段。
- 为什么改:`notify` 节点唯一的渠道被拒(如未注册的 `push`)时,步骤日志里有告警,但触发接口返回的摘要里该行只显示
`success`、`acted: 0`,调用方看不出其实谁都没通知到。
- 风险与回滚:只加可选字段,节点状态、计数和流程走向都不变;每个节点最多列 5 条不同告警,超出时最后一条写明省略了几条。回滚即 revert
本 PR。
-
先看:`packages/services/service-automation/src/run-summary.ts`(折叠与上限,`nodeWarnings`);`packages/spec/src/automation/execution.zod.ts`(新字段与描述);`packages/services/service-automation/src/builtin/notify-delivery-outcome.integration.test.ts`(末尾新
describe)。
- 两分钟验证:`pnpm --filter @objectstack/service-automation exec vitest run
src/builtin/notify-delivery-outcome.integration.test.ts`,预期 12 个用例全绿,其中新
describe 的 4 个用例断言摘要行带有点名 `'push'` 的告警。
- 需要你做的:无,席位落地。
## What changes
- `@objectstack/spec`: `FlowRunNodeSummarySchema` gains `warnings?:
string[]`, the same element shape as `ExecutionStepLogSchema.warnings`.
Optional and additive: absent when no execution of the node raised a
warning, never `[]`.
- `@objectstack/service-automation`: `summarizeRun` folds every node's
step `warnings` onto that node's row, distinct texts in first-seen
order. The list is bounded per node (`MAX_NODE_SUMMARY_WARNINGS = 5`,
not exported from the package entry) because the summary's detail is
sized by the flow's static shape, which is what keeps a long sweep's
persisted `summary_json` under its byte cap; past the bound a final
entry says how many distinct warnings were left out, and the step log
keeps each execution's own.
- Every node type's step warnings ride along, not only `notify`'s: a
`create_record` / `update_record` whose requested fields were stripped
now says so on its row too. One fold over the step log covers the whole
class instead of a `notify` special case.
- Unchanged: node `status`, every counter, the run's outcome and flow
control. A refused channel is still a successful step, as #32143's fix
decided.
- Generated: `packages/spec/authorable-surface/automation.json` (+1 key)
and `content/docs/references/automation/execution.mdx`, both from
`check:generated --fix`. `authorable-surface.base.json` is untouched.
- Changeset `.changeset/33341-notify-summary-row-warning.md`: `minor`
for both packages, with both declaration lines.
The trigger door serves the engine's result verbatim
(`deps.success(result)`, `packages/runtime/src/domains/automation.ts`),
so the engine's `run.summary` is the trigger response's `summary`; the
same summary rides a flow door's `400 FLOW_FAILED` details and the
persisted run row.
## Why
The run already stopped claiming a false success (#32143), but a caller
reading only the trigger response's summary still saw a notify row with
`status: 'success'`, `acted: 0` and no reason, so it could not tell
"nothing to send" from "the only channel was refused". The card asks for
the warning on that row, in the shape other nodes already use for
warnings (the step log's `warnings`).
Metadata-protocol is `added` and not `none` because `FlowRunNodeSummary`
is on the spec's authorable-surface baseline, and the changeset gate
refuses `none` beside a moved `authorable-surface/` file. Clause-② is
`yes (widening)`: an optional member added to a published response
schema.
## Tests
All readings on head `c14afda2e9`.
- Premise, re-measured before the fix on the real run path
(`AutomationEngine.execute` with the real `MessagingService`, outbox and
dispatcher): the new describe in
`notify-delivery-outcome.integration.test.ts` went **red, 3 failed / 9
passed (12)**, `AssertionError: Target cannot be null or undefined.` on
the row's `warnings`; the CONTROL case (registered channel, no warning)
stayed green.
- New pins: 4 cases in a new top-level describe in
`notify-delivery-outcome.integration.test.ts` (durable path, inline
path, partial delivery, control); each parses the summary through
`FlowRunSummarySchema`, so an undeclared member would be stripped and
the case would go red. 5 cases in `run-summary.test.ts` (distinct
first-seen fold, absent on other rows and on skipped nodes, a failed
execution's warnings, the bound with its overflow entry, a list exactly
at the bound). 3 cases in
`packages/spec/src/automation/execution.test.ts` (kept through a parse,
absent stays absent, a non-string entry is refused at `['warnings',
0]`).
- Ablation on the committed fix, through `scripts/ablation-replace.mjs`:
anchor `if (warnings) node.warnings = warnings;` 1 → 0, blob `bacf67bb`
→ `ef6fbf30`; **8 failed / 51 passed (59)**, every new warning pin red
and the control green. Restored: blob == HEAD `bacf67bb`, `git diff
HEAD` empty. The tests import `run-summary.ts` from `src`, so no dist
leg.
<details><summary>Suite readings (os-verify-lock VERDICT
lines)</summary>
- `pnpm --filter @objectstack/service-automation test`: Test Files 281
passed (281), Tests 3916 passed (3916), VERDICT command-exit 0.
- `pnpm --filter @objectstack/service-automation typecheck` (tsc +
check:test-typecheck): exit 0.
- `pnpm --filter @objectstack/spec test`: Test Files 840 passed (840),
Tests 26868 passed, 1 todo (26869), VERDICT command-exit 0.
- `pnpm --filter @objectstack/spec typecheck`: exit 0.
- `pnpm --filter @objectstack/runtime typecheck` + `vitest run` of
`flow-failed-inner-refusal`, `endpoint-flow-dispatch-status`,
`automation-trigger-paused-run`, `automation-runs-unknown-flow`: Test
Files 4 passed (4), Tests 39 passed (39), VERDICT command-exit 0.
- `eslint --no-inline-config` over the five touched source and test
files: exit 0.
</details>
## Acceptance notes
- Narrowed dependent testing, declared: the spec change is an optional
member on a response schema, so of the downstream consumers only
`@objectstack/runtime` (the trigger door and the typed
`FlowFailureDetails` builder) was re-run locally, its typecheck plus the
four test files that read the summary. Every other dependent is left to
CI's `Test Core` and `TypeScript Type Check`. A `turbo ls --affected`
set would be blind to tests that read another package's source from
disk, and the repo-root suites are not on that graph at all.
- Not merged with `origin/main` before opening: the branch is 9 commits
behind, none touching `packages/spec/src/automation`, `run-summary.ts`,
the authorable-surface or the reference docs (read with `git diff
HEAD...origin/main` on those paths); the merge queue tests the merged
tree.
- A `subflow` child's warnings stay on the child's own run row, as its
`skipped` gates do; the parent's `subflow` row carries only warnings its
own step raised.
- The Console's Runs panel reads step warnings and is not changed here;
whether it shows the summary row's warnings is a UI question for another
card.
## Verification
<details><summary>Derived gates (dispatch-gates --commands at
c14afda, 8 paths vs merge base b462444)</summary>
- 109 derived commands, each run with its exit code captured before any
pipe; `dispatch-gates --ran`: **109 accounted for, 107 run, 2 NOT
MEASURED, 0 UNRUN**.
- NOT MEASURED, family `check:skill-examples` (spec), reason: exit 3
PREREQUISITE NOT MET, it compiles the skill examples against built
`@objectstack/client` / `@objectstack/client-react` declarations, and
this container has not built them.
- NOT MEASURED, family `check:dual-build-cjs-loads`, reason: exit 3
PREREQUISITE NOT MET, it loads 38 packages' built CJS entries and needs
a full `pnpm build`.
- Both run in CI's `Lint & Repo Gates` on this PR.
- `pnpm --filter @objectstack/spec check:generated` after `--fix`: 14 of
14 artifacts current (it had named `check:docs` stale once, regenerated
above); `check:authorable-surface` and `check:api-surface` green.
</details>
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes (eslint run over the
touched files; the repo-wide run is CI's).
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
Seat: `domain:server#5 · os-elon-musk ·
session_016WV4cykhsWAtSL6Sr4VWFG`, dispatched to an os-dev subagent on
claim 6883603057.
---
_Generated by [Claude
Code](https://claude.ai/code/session_016WV4cykhsWAtSL6Sr4VWFG)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 8fdf25a commit 8b53cc8
8 files changed
Lines changed: 231 additions & 1 deletion
File tree
- .changeset
- content/docs/references/automation
- packages
- services/service-automation/src
- builtin
- spec
- authorable-surface
- src/automation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| 309 | + | |
309 | 310 | | |
310 | 311 | | |
311 | 312 | | |
| |||
339 | 340 | | |
340 | 341 | | |
341 | 342 | | |
| 343 | + | |
342 | 344 | | |
343 | 345 | | |
344 | 346 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
290 | 291 | | |
291 | 292 | | |
292 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
138 | 186 | | |
139 | 187 | | |
140 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
73 | 83 | | |
74 | 84 | | |
75 | 85 | | |
| |||
85 | 95 | | |
86 | 96 | | |
87 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
88 | 102 | | |
89 | 103 | | |
90 | 104 | | |
| |||
131 | 145 | | |
132 | 146 | | |
133 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
134 | 157 | | |
135 | 158 | | |
136 | 159 | | |
| |||
177 | 200 | | |
178 | 201 | | |
179 | 202 | | |
| 203 | + | |
| 204 | + | |
180 | 205 | | |
181 | 206 | | |
182 | 207 | | |
| |||
194 | 219 | | |
195 | 220 | | |
196 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
197 | 255 | | |
198 | 256 | | |
199 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
245 | 246 | | |
246 | 247 | | |
247 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
437 | 460 | | |
438 | 461 | | |
439 | 462 | | |
| |||
0 commit comments