Commit eed0997
committed
refactor: strip comments and compress the spend-exclusion code
Removes comments and docstrings from the files this PR introduces, and
takes out what the red-team pass found was dead or duplicated. Net -613
lines across 27 files.
Dead code removed: the `byok_env` plumbing through `_settle_trial_metering`
and `store_trial_results`, whose only reader was the deleted key-hash
stamp; the unused `exclusions` parameter on `build_task_status_response`,
which no caller passed because `task_detail` rebuilds the trial list
itself; and `CostExclusions.__bool__`.
Deduplicated: the four Next.js proxy routes now use the app's shared
`proxyBackendJson` / `proxyJsonRequest` instead of reimplementing them —
83 lines down to 10 — which also restores request-id propagation, upstream
server-timing, and abort-signal forwarding, and drops the bespoke
`{error, details}` envelope in favour of the backend payload the rest of
the app already forwards. The two routers share `unavailable` and
`soft_delete`; their genuinely different halves (model resolution against
`trials.model` returning a list, experiment id-or-name resolution
rejecting collections) stay separate.
Pre-existing prose in shared modules is untouched — the accounting
rationale in `cost_basis`, `experiment_cost`, `quotas` and `helpers`
documents other features and this PR has no business deleting it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017zmdrcCqnkVM6hWjhPu2T91 parent d147ed8 commit eed0997
27 files changed
Lines changed: 132 additions & 715 deletions
File tree
- backend
- api/routers
- tests
- frontend/src
- app
- (app)/tasks/[task_id]
- api/admin
- cost-excluded-experiments
- [id]
- cost-excluded-models
- [id]
- components
- lib
- oddish
- alembic/versions
- src/oddish
- cli
- core
- endpoints
- db
- workers/queue
- worker
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | 1 | | |
9 | 2 | | |
10 | 3 | | |
| |||
15 | 8 | | |
16 | 9 | | |
17 | 10 | | |
| 11 | + | |
18 | 12 | | |
19 | 13 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 14 | + | |
27 | 15 | | |
28 | 16 | | |
29 | 17 | | |
| |||
53 | 41 | | |
54 | 42 | | |
55 | 43 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | 44 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | 45 | | |
79 | 46 | | |
80 | 47 | | |
| |||
97 | 64 | | |
98 | 65 | | |
99 | 66 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | 67 | | |
113 | 68 | | |
114 | 69 | | |
| |||
123 | 78 | | |
124 | 79 | | |
125 | 80 | | |
126 | | - | |
| 81 | + | |
127 | 82 | | |
128 | 83 | | |
129 | 84 | | |
130 | 85 | | |
131 | 86 | | |
132 | 87 | | |
133 | 88 | | |
134 | | - | |
| 89 | + | |
135 | 90 | | |
136 | 91 | | |
137 | 92 | | |
| |||
140 | 95 | | |
141 | 96 | | |
142 | 97 | | |
143 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
144 | 107 | | |
145 | 108 | | |
146 | 109 | | |
| |||
153 | 116 | | |
154 | 117 | | |
155 | 118 | | |
156 | | - | |
157 | 119 | | |
158 | 120 | | |
159 | 121 | | |
| |||
167 | 129 | | |
168 | 130 | | |
169 | 131 | | |
170 | | - | |
| 132 | + | |
171 | 133 | | |
172 | 134 | | |
173 | 135 | | |
174 | 136 | | |
175 | 137 | | |
176 | 138 | | |
177 | 139 | | |
178 | | - | |
| 140 | + | |
179 | 141 | | |
180 | 142 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
185 | 148 | | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | 149 | | |
194 | | - | |
| 150 | + | |
195 | 151 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | 44 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | 45 | | |
68 | 46 | | |
69 | 47 | | |
| |||
75 | 53 | | |
76 | 54 | | |
77 | 55 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | 56 | | |
82 | 57 | | |
83 | 58 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
88 | 66 | | |
89 | 67 | | |
90 | 68 | | |
| |||
103 | 81 | | |
104 | 82 | | |
105 | 83 | | |
106 | | - | |
| 84 | + | |
107 | 85 | | |
108 | 86 | | |
109 | 87 | | |
| |||
153 | 131 | | |
154 | 132 | | |
155 | 133 | | |
156 | | - | |
| 134 | + | |
157 | 135 | | |
158 | 136 | | |
159 | 137 | | |
| |||
164 | 142 | | |
165 | 143 | | |
166 | 144 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
| 145 | + | |
| 146 | + | |
171 | 147 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | 148 | | |
180 | | - | |
| 149 | + | |
181 | 150 | | |
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
| |||
136 | 134 | | |
137 | 135 | | |
138 | 136 | | |
139 | | - | |
140 | 137 | | |
141 | 138 | | |
142 | 139 | | |
| |||
147 | 144 | | |
148 | 145 | | |
149 | 146 | | |
150 | | - | |
151 | 147 | | |
152 | 148 | | |
153 | 149 | | |
154 | 150 | | |
155 | 151 | | |
156 | 152 | | |
157 | | - | |
158 | 153 | | |
159 | 154 | | |
160 | 155 | | |
| |||
166 | 161 | | |
167 | 162 | | |
168 | 163 | | |
169 | | - | |
170 | | - | |
171 | 164 | | |
172 | 165 | | |
173 | 166 | | |
| |||
263 | 256 | | |
264 | 257 | | |
265 | 258 | | |
266 | | - | |
267 | 259 | | |
268 | 260 | | |
269 | 261 | | |
| |||
0 commit comments