You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a198945
Browse filesBrowse the repository at this point in the historyBrowse files
feat(approvals): judge a package publish as the batch will leave it live
At a package publish's promotion the added authoring gates are handed the
batch's object and flow drafts, and the approvals publish check reads them in
place of the live items of the same name. A package that declares closedStates
and repairs the flow it closes on in one publish goes through in either order.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5nzgcVrZ8Neqqd1AFi
Copy file name to clipboardExpand all lines: .changeset/37766-publish-gate-approvals.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ At kernel:ready the plugin adds publish gates for `flow` and `object` beside the
13
13
14
14
-**A flow.** It is judged as an approval's root, together with every flow that calls it through a `subflow` or a `map`, to any depth, with the written body in place. The walk up the callers ends on a flow that calls itself and on flows that call each other. It stops after 64 roots: past that, nothing is refused for the cap, and one warning says so.
15
15
-**An object.** Every flow that can start on one of its records, or maps over them, is judged with the written object in place. Only gaps on the written object are reported.
16
+
-**A package publish.** The batch's other objects and flows are read in place of the live ones of the same name. A package that declares `closedStates` and repairs the flow it closes on in the same publish goes through, whichever draft is promoted first.
16
17
17
18
The refusal is a 400 `VALIDATION_FAILED` that names the item, then gives one sentence per gap: the flow, the step, the object, the field and what is missing, in the first locale the write door states. These are the same sentences an approval's first request is refused with.
Widened: `ObjectStackProtocolImplementation` gains `addAuthoringGate(type, gate)`, and `MetadataAuthoringGateContext` gains an optional `pending`.
11
11
12
12
`registerAuthoringGate` keeps one gate per type, and a second registration still replaces the first. A plugin that needs to judge a type another plugin owns now adds its gate with `addAuthoringGate` instead. plugin-security owns `object`, for example.
13
13
14
14
- An added gate runs after the owner gate, in the order gates were added, on every write the owner gate runs on: a save in either mode, and a restore.
15
15
- An added gate also runs when a draft is promoted to `active` (`publishMetaItem`, a package publish, a judge-only call), with `state: 'active'`. The owner gate still does not run there.
16
+
- At a package publish's promotion, an added gate is handed `pending`: the `object` and `flow` bodies of the batch's drafts, which go `active` with this one. A gate that reads other items reads these in place of the live ones of the same name, so a batch is judged as it will be live. `pending` is absent on a save, a restore and a single publish.
16
17
- A declared `package-author` channel runs no added gate, as it runs no owner gate.
17
18
- A throw from an added gate refuses the write before it is stored, as an owner gate's does.
0 commit comments