Commit 3d3f60e
fix(approvals,rest,types): a stranded decision publishes finalized / decision / runId / repairable beside its 500 (#15436)
* fix(approvals,rest,types): a stranded decision publishes finalized/decision/runId/repairable beside its 500
Maintainer ruling 2026-09-04, decision batch #37, option B. One
`POST /api/v1/approvals/requests/{id}/reject` produced three coexisting
outcomes: the caller read HTTP 500, the request row WAS terminal and had
left the pending inbox, and the run was stranded. 500 alone reads as "the
rejection did not happen", so callers retried against a durable decision.
The status code does not move — the effect landing while the run strands
is still a failure — and the door does not become atomic: the #13937
shape-4 ruling binds this door's own writes too, so no decision is ever
rolled back. What changed is that the door stops discarding what the
engine said.
- `serviceResume` carries `AutomationResult.status` through. It read only
success/code/error, and the stranded exit reports a status and NO code,
so the repairability signal died one line before the envelope was built
— a member with a producer and, until now, zero consumers.
- `resumeRecordedOutcome` throws a carrier with `finalized` (the decision
stands), `decision`, `runId`, and `repairable` derived from the engine's
`'stranded'` discriminator. Absence of that stamp is `false`, never a
default: a repair verb that would refuse is worse than no promise.
- The REST approvals door forwards those four fields on `RESUME_FAILED`
only, presence-gated — an error with no carrier answers exactly the body
it always did.
- `@objectstack/types` hosts the constructor and its recogniser in one
module (the producer is a plugin; rest cannot import one), the same Home
rule as the validation-failure pair beside it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XpTx2tbq3pZRYAdoGt6E6Y
* test(approvals): route the new pin's engine double through ObjectQL's dispatch predicates
`check:engine-double-contract` and `check:objectql-double-limit` both caught
the new fake in `decision-strand-envelope.test.ts`: its `update()`/`delete()`
hand-rolled the dispatch and its `find()` read the caller's bound by
truthiness, so `limit: 0` would have returned the whole table. Both verbs now
open with `assertEngineUpdateDispatch` / `assertEngineDeleteDispatch` and the
bound is honoured by presence; the two new rows are recorded in the pinned
ledger (`--write`, 2 added, 0 lost).
`check:system-context-census` anchors are re-anchored by its own `--fix`: pure
line rot from this branch's edits, uniform +5 on `rest-server.ts` (the import
block) and +52 on `approval-service.ts` (the docblocks), which is what makes it
rot rather than a finding.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XpTx2tbq3pZRYAdoGt6E6Y
* chore(docs): regenerate the system-context census page from the merged tree
The os-regen merge driver hands this page back rather than text-merging it —
it is generated. Regenerated with `pnpm gen:system-context-census` after
merging origin/main; the three re-anchors are all line rot in
`packages/runtime/src/domains/actions.ts` (+10 from upstream commits), none
of them this branch's own files.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XpTx2tbq3pZRYAdoGt6E6Y
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent 19fa30c commit 3d3f60e
10 files changed
Lines changed: 719 additions & 11 deletions
File tree
- .changeset
- content/docs/permissions
- packages
- plugins/plugin-approvals/src
- rest/src
- types/src
- 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| |||
Lines changed: 60 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
2665 | 2665 | | |
2666 | 2666 | | |
2667 | 2667 | | |
2668 | | - | |
| 2668 | + | |
| 2669 | + | |
2669 | 2670 | | |
2670 | 2671 | | |
2671 | 2672 | | |
2672 | 2673 | | |
2673 | 2674 | | |
2674 | 2675 | | |
2675 | | - | |
| 2676 | + | |
2676 | 2677 | | |
| 2678 | + | |
2677 | 2679 | | |
2678 | 2680 | | |
2679 | 2681 | | |
| |||
2683 | 2685 | | |
2684 | 2686 | | |
2685 | 2687 | | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
2686 | 2705 | | |
2687 | 2706 | | |
2688 | 2707 | | |
| |||
2788 | 2807 | | |
2789 | 2808 | | |
2790 | 2809 | | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
| 2813 | + | |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
| 2820 | + | |
| 2821 | + | |
| 2822 | + | |
| 2823 | + | |
| 2824 | + | |
| 2825 | + | |
| 2826 | + | |
| 2827 | + | |
2791 | 2828 | | |
2792 | 2829 | | |
| 2830 | + | |
| 2831 | + | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
2793 | 2835 | | |
2794 | 2836 | | |
2795 | 2837 | | |
2796 | 2838 | | |
2797 | 2839 | | |
2798 | 2840 | | |
| 2841 | + | |
2799 | 2842 | | |
2800 | 2843 | | |
2801 | 2844 | | |
| |||
2810 | 2853 | | |
2811 | 2854 | | |
2812 | 2855 | | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
2813 | 2863 | | |
2814 | | - | |
| 2864 | + | |
2815 | 2865 | | |
2816 | | - | |
| 2866 | + | |
2817 | 2867 | | |
2818 | 2868 | | |
| 2869 | + | |
2819 | 2870 | | |
2820 | 2871 | | |
2821 | 2872 | | |
| |||
2862 | 2913 | | |
2863 | 2914 | | |
2864 | 2915 | | |
| 2916 | + | |
2865 | 2917 | | |
2866 | 2918 | | |
2867 | 2919 | | |
| |||
3254 | 3306 | | |
3255 | 3307 | | |
3256 | 3308 | | |
| 3309 | + | |
3257 | 3310 | | |
3258 | 3311 | | |
3259 | 3312 | | |
| |||
3295 | 3348 | | |
3296 | 3349 | | |
3297 | 3350 | | |
| 3351 | + | |
3298 | 3352 | | |
3299 | 3353 | | |
3300 | 3354 | | |
| |||
3384 | 3438 | | |
3385 | 3439 | | |
3386 | 3440 | | |
| 3441 | + | |
3387 | 3442 | | |
3388 | 3443 | | |
3389 | 3444 | | |
| |||
0 commit comments