Commit 779953c
release: v0.9.6 review round 3 — revert P2 self-heal; document contract
Reverts the round-2 self-heal (was: on stale-generation success, clear
`_registrationPromise` so the current hook re-runs). Coderabbit + cubic
both correctly flagged that this reintroduces the very race the round-1
generation guard was meant to prevent: if the stale hook resolves while
a REPLACEMENT hook is still in flight, clearing `_registrationPromise`
clobbers the newer attempt's cached promise — a third caller then starts
a second registration attempt, breaking dedup.
Every attempt to self-heal without inventing a heavier per-entry
generation scheme (or wrapping ``register()`` with a generation guard)
introduces another race. Doing that here would materially complicate
the dispatcher for a scenario that never occurs in production —
``setRegistrationHook`` is called exactly once at startup by
``native/index.ts``, and ``reset()`` is test-only. Test-authored races
that violate isolation are the caller's contract, not this module's
correctness problem.
- Revert to round-1 logic (generation guard on shared-state mutations only)
- Remove the "stale hook self-heal" adversarial test — it was locking in
behavior we've decided not to guarantee
- Add explicit contract documentation to `dispatcher.ts` and to the
adversarial test file's top docstring so the design decision is
discoverable to reviewers next time
Dispatcher suite: 14/14 pass (was 15 with the deleted self-heal test).
The round-1 generation guard is retained and still tested.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 6400201 commit 779953c
2 files changed
Lines changed: 26 additions & 58 deletions
File tree
- packages/opencode
- src/altimate/native
- test/skill
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
64 | 73 | | |
65 | 74 | | |
66 | 75 | | |
67 | 76 | | |
68 | 77 | | |
69 | 78 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
| 85 | + | |
| 86 | + | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
| |||
Lines changed: 11 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
8 | 17 | | |
9 | 18 | | |
10 | 19 | | |
| |||
179 | 188 | | |
180 | 189 | | |
181 | 190 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | 191 | | |
227 | 192 | | |
228 | 193 | | |
| |||
0 commit comments