Repository navigation
Commit baa38c0
docs(approvals): a record delete cancels the parked flow run (#38295)
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu39QwNEMYYq9N1C1xLDGdAJ)_
Fixes #37763
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:写流程的开发者(和帮他写的
AI)在审批技能和审批指南里读到:单据在等审批时被删掉,等它的流程运行会被取消,批准、驳回两条后续都不走;要在删除时做事,写在单据的删除钩子上。指南还写明子流程、批量的情形,以及管理员如何找到此前遗留的暂停运行并手动取消。
- 为什么做:维护者在这张卡上选了「自动取消」,代码改动在另一个 PR;技能和指南此前没说删除后流程会怎样。
- 出错会怎样:只改说明文字,不改行为;技能页仍在字数上限内,新增的话由同页压缩旧措辞抵付,没有删规则。可直接撤回。
- 要你做什么:这个 PR 碰 `skills/**`,属受治理路径,需你审批合并;请在代码 PR #38293 合入后再合,免得文档先于行为。
## What changes
-
`skills/objectstack-automation/references/state-machines-and-approvals.md`,
Approval Best Practices item 2: deleting the pending record now also
cancels its parked run; neither `approve` nor `reject` runs, so a
delete-time action goes in the record's delete hook. The page is at its
token ceiling (headroom 0); the clause is paid for on the same page by
cutting restatements, no rule dropped:
- "exactly **three roots** — nothing else" drops "nothing else";
- "guard genuinely-optional inputs explicitly" is "guard optional
inputs";
- item 2's "the child object declares" is "the child declares";
- item 3's prohibition is one clause ("⛔ a `notify` node there tells
them twice");
- item 4 is compressed. Two rewordings there are worth a look: "a
`runAs: 'user'` flow fired by one has its data steps refused" now reads
"and refuse a `runAs: 'user'` flow's data steps" (the two transitions as
subject), and "runs with the decider's own grants" reads "with that
person's grants" (which also covers the submitter on submit).
- `content/docs/automation/approvals.mdx`, the paragraph on deleting a
pending record: two sentences. The flow run waiting on the request is
cancelled for the same reason, so neither branch runs; inside `subflow`
steps on the same record every run up the chain is cancelled; a batch
(`map`) item's batch goes on to its next item and records the deleted
one as cancelled. Runs left paused by earlier deletes are not cleaned
up: find them by the cancelled request whose `cancel_reason` is
`record_deleted`, which names its run in `flow_run_id`, and cancel that
run by hand if it is still `paused`: requests voided by a delete after
#38293 carry the same reason, and their runs already show `cancelled`
(half-sentence added at `4d8dea85` per contract review 7238666618 ③;
`paused` per 7238784724 at `4fdcc1aa`).
- Changeset: `.changeset/37763-skills-delete-cancels-parked-run.md`,
`@objectstack/skills` patch (a `skills/**` change releases that
package).
## Why
Maintainer ruling on #37763, option A (card comment 7237973760): a
record delete cancels the run parked on the approval it voids. The
behaviour lands in #38293, which only refers to the card (this PR is the
one that closes it); the ruling's landing names one sentence in the
approvals skill (paid for on the same page) and one in the approvals
guide, which unlocks the card's second checkbox. The guide's addition is
two sentences: subflow, batch and the hand clean-up of earlier runs did
not fit one.
## Verification
- Token ratchet: `state-machines-and-approvals.md` 5927 before, 5927
after (ceiling 5927); bytes 23706 → 23706; lines 388 → 388; whole skills
bundle 303542 → 303542. Ceiling and baseline untouched.
- Wording checked against the shipped code in #38293
(`cancelForDeletedRecord`, `cancelRunsOfVoidedRequest`): the run's
cancel reason is a sentence, not `record_deleted`, so the guide says
"for the same reason" and keeps `record_deleted` for the request's
`cancel_reason`.
<details><summary>Local runs</summary>
Head `4fdcc1aa` (base `main` `216524a2`); `4d8dea85` and `4fdcc1aa`
touch only `content/docs/automation/approvals.mdx`, the skill page and
its tokens are as at `8001d106`. Written by an isolated sub-agent served
at the contract-review tier for every turn (`verify-review-tier.mjs` on
its transcript: PASS).
- `node scripts/pm/dispatch-gates.mjs --commands` (derived before the
changeset commit): 62 families; 58 exit 0 (5 of them after building
`@objectstack/lint...` and `@objectstack/client-react...`, their
prerequisite), 4 NOT MEASURED, exit 3, needing a whole-repo build:
`check:dts-closure`, `check:dual-build-cjs-loads`,
`check:lean-entry-closure`, `check:sourcemap-no-sources-content` (they
read package dists; this diff touches none). `check:skill-docs`,
`check:skill-refs`, `check-skills-token-ratchet.mjs` and its
`--self-test` exit 0. The changeset-only families are left to CI.
</details>
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind. (none added)
- [x] 3. No formatter ran.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request. (branch `claude/project-thread-sz9xxz-skills`; the code half is
#38293 on `claude/project-thread-sz9xxz`)
- [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: no.
- [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 (the 维护者速读 block is the
maintainer summary).
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L6bhgUpmvWke9Z2P4VKvaD
<!-- signed: repo:objectstack#2 · os-sales ·
session_01L6bhgUpmvWke9Z2P4VKvaD -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 326f9db commit baa38c0
3 files changed
Lines changed: 36 additions & 15 deletions
File tree
- .changeset
- content/docs/automation
- skills/objectstack-automation/references
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
421 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
422 | 432 | | |
423 | 433 | | |
424 | 434 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
373 | | - | |
374 | | - | |
375 | | - | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
376 | 378 | | |
377 | 379 | | |
378 | | - | |
379 | | - | |
| 380 | + | |
380 | 381 | | |
381 | 382 | | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
0 commit comments