Commit 077d3af
fix: deterministic TypeScript type generation for run-config.ts (#194)
## Summary
The `typescript_generation` test in CI was flaky due to
non-deterministic ordering of type declarations in `run-config.ts`.
### Root cause
`ts_rs::visit_dependencies` traverses type dependencies using a
`HashMap` internally, so the visitation order of sibling types (e.g.
`UserGlobalCacheConfig` vs `Task`) varies between runs. This caused
`generate_ts_definition()` to emit declarations in a random order,
making the test pass or fail depending on whether the output happened to
match the checked-in file.
### Fix
- Sort the collected type declarations alphabetically before emitting
them, ensuring deterministic output regardless of `HashMap` iteration
order
- Regenerate `run-config.ts` with the now-stable ordering
Verified stable across 20 consecutive regenerations.
https://claude.ai/code/session_014eMPQ1Mw6EQpPkjkk1onsQ
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 9ce14cf commit 077d3af
2 files changed
+27
-24
lines changed| 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 | 1 | | |
26 | 2 | | |
27 | 3 | | |
| |||
60 | 36 | | |
61 | 37 | | |
62 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
228 | 231 | | |
229 | 232 | | |
230 | 233 | | |
| |||
0 commit comments