Repository navigation
Commit e67c383
committed
fix(s126): complete slice 126 (nothing about an approval is discarded in silence)
This slice is a retraction. The defect it was opened for does not exist.
The approval handshake is correct. A decision arriving while the Session is in
tool_wait is postponed and redelivered on the next state change, exactly as the
comment in session.ex claims, and a decision made straight through
Permissions.decide_request/3, with no LiveView in the loop, is applied. The
owner's invariant already held.
Both reproductions I reported are withdrawn.
The suite one was my own test bug. It ended with
collect(id, &match?({:state, :idle}, &1), 15_000)
and collect/3 reads the mailbox, where an {:state, :idle} broadcast from before
the message was sent was already waiting. It returned at once and every
assertion ran mid-turn. The tell was in the output all along: "Finished in 0.2
seconds" for a test nominally waiting fifteen.
The live one was scripts/dev_demo_approval.sh, which I wrote the previous day
for the README assets. It stripped the sandbox pool from Trinity.Repo and did
nothing for Trinity.Repo.Receipts, so outside the suite that pool sat in auto
mode and, as config/test.exs warns in its own comment about the other repo, the
first long-lived process to query held the connection until it exited.
Effects.Runner.execute/3 receipts a decision before it dispatches, which is what
makes "nothing fails open" true, so every Receipts.append/2 queued behind that
holder and the tool task blocked after the approval row existed and the card was
painted but before it could answer the Session. Hence consumed_at nil, a chain
carrying the ask and not the allow, and a visible "error: the tool timed out".
Every symptom was real and the cause was mine. The intermittency was the sandbox
connection sometimes being free.
What lands:
- scripts/dev_demo_approval.sh: the sandbox pool stripped from both repos, the
receipts database pointed at its own file rather than the test suite's, and no
apostrophes inside the -e block. That last one is not cosmetic: a single
apostrophe terminates the quoted string and the script dies with no output.
Browser drives go from stalling in tool_wait at 14s and counting to reaching
approval_wait at t=0s and completing 5 of 5, with the chain reading ask,
allow, effect admit, effect done.
- One change under lib/, and only one, because the instruction was explicit that
no product bug be invented to fill the slice. The catch-all for
{:approval, _, _} discarded any unmatched approval event without a word, and a
trace showed :requested discarded in tool_wait on every single turn. A
:requested stays routine and is deliberately not given a second path into the
approval flow. Anything else is an answer with no held call to apply it to,
which is the one shape that can lose a decision, so it is logged and receipted
as outcome=dropped. The receipt is written off the session's task supervisor,
never inline, because blocking the Session on a receipt write is the precise
shape of the stall this slice was opened to explain. Red first: AC6 fails
against the old clause at 3/4 and passes at 4/4.
- Three LiveView tests as regression cover. They pass against unmodified lib/
and PROOF.md says so rather than dressing them as a fix. They exist because
every approval test in the tree synchronises on {:state, :approval_wait}
before clicking, which no real caller can do, so the ordering a browser
actually produces had never been exercised.
Signed-off-by: Ayla Croft <aylacroft@proton.me>1 parent b6304db commit e67c383
4 files changed
Lines changed: 165 additions & 8 deletions
File tree
- lib/trinity/sessions
- scripts
- test/trinity_web/live
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 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 | + | |
27 | 54 | | |
28 | 55 | | |
29 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
272 | 298 | | |
273 | 299 | | |
274 | 300 | | |
| |||
714 | 740 | | |
715 | 741 | | |
716 | 742 | | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
717 | 768 | | |
718 | 769 | | |
719 | 770 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
16 | 28 | | |
17 | 29 | | |
18 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
56 | 83 | | |
57 | 84 | | |
58 | 85 | | |
59 | 86 | | |
60 | 87 | | |
61 | 88 | | |
62 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
63 | 93 | | |
64 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
65 | 97 | | |
66 | 98 | | |
67 | 99 | | |
68 | | - | |
| 100 | + | |
69 | 101 | | |
70 | 102 | | |
71 | 103 | | |
| |||
83 | 115 | | |
84 | 116 | | |
85 | 117 | | |
86 | | - | |
| 118 | + | |
87 | 119 | | |
88 | 120 | | |
89 | 121 | | |
| |||
93 | 125 | | |
94 | 126 | | |
95 | 127 | | |
| 128 | + | |
96 | 129 | | |
97 | | - | |
| 130 | + | |
98 | 131 | | |
99 | 132 | | |
100 | 133 | | |
| |||
128 | 161 | | |
129 | 162 | | |
130 | 163 | | |
131 | | - | |
| 164 | + | |
132 | 165 | | |
133 | 166 | | |
134 | 167 | | |
135 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
136 | 203 | | |
0 commit comments