Commit 8b01371
committed
feat(actions): durable packaged-action disable — same activation ledger, dispatch-time consult
Generalizes the packaged-flow disable machinery to actions (ADR-0126 §8 item 2,
maintainer amendment ruling 3). A packaged action can be switched off for an
installation; the flip writes an install-level row to the SAME
`sys_metadata_activation` object with `metadata_type: 'action'` — no schema
change, no new column, no clone machinery.
The consult sits at action DISPATCH, on every door that dispatches a declared
action: the REST `/actions/:object/:action` route and the MCP `run_action`
bridge, both through one shared guard. A disabled action is refused
`409 ACTION_DISABLED` before the handler body runs (it executes trusted), before
a flow-type action reaches the automation engine, before the param contract and
before the record load — and after the ADR-0066 D4 capability gate, so the
switch is not an oracle for unentitled callers.
The code is registered rather than borrowed: `FLOW_DISABLED` would tell an
operator to go hunting for a flow that does not exist. It is one census row in
the ADR-0112 ledger, in the `*_DISABLED` family that already names which thing
is off.
The projection lives on the ObjectQL engine and is hydrated at boot by its
plugin — the component ADR-0110 D5 already established as unconditionally
present wherever actions execute — so a disable survives a restart and the
handler re-registration every metadata reload performs. A ledger object absent
from the composition is read as absent, not probed, and re-checked on the next
reload rather than recorded as a verdict.
The write door is `POST /actions/_activation/:object/:action`, its segment
reserved because machine names cannot begin with `_`. It carries the same two
authority tiers as the flow toggle — `manage_metadata`, then the ADR-0126 §5
posture rule — now sharing ONE gate implementation with
`POST /automation/:name/toggle` instead of a second copy; the flow refusal text
is byte-identical to what it shipped with. An ambiguous action name is refused
`409 RESOURCE_CONFLICT` rather than switching off artifacts the caller did not
name, and a flip that cannot be made durable is reported as a failure instead
of a 200.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KWRU3s15AJz7PGW7a7wdCh1 parent 1524927 commit 8b01371
18 files changed
Lines changed: 2512 additions & 90 deletions
File tree
- .changeset
- content/docs/references/api
- packages
- objectql/src
- runtime/src
- domains
- spec/src/api
- scripts
| 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 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
| |||
0 commit comments