@vtxmacro/cli 2026.10.13 → 2026.10.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/exo-harness.ts +1610 -240
- package/bin/vtx-mcp.js +925 -78
- package/bin/vtx-service-bootstrap.js +861 -67
- package/bin/vtx-service-launcher.js +854 -60
- package/bin/vtx.js +4830 -2529
- package/package.json +1 -1
|
@@ -28,6 +28,7 @@ var runtime_policy_generated_default = {
|
|
|
28
28
|
post_execution_refresh_delay_ms: 3e3,
|
|
29
29
|
account_read_backoff_min_ms: 2e3,
|
|
30
30
|
account_read_backoff_max_ms: 6e4,
|
|
31
|
+
account_read_backoff_exponent_max: 30,
|
|
31
32
|
ai_start_grace_min_ms: 45e3
|
|
32
33
|
},
|
|
33
34
|
deployment_reload_observability: {
|
|
@@ -52,7 +53,8 @@ var runtime_policy_generated_default = {
|
|
|
52
53
|
load_timeout_ms: 5e3,
|
|
53
54
|
initial_load_settle_ms: 100,
|
|
54
55
|
external_save_timeout_ms: 8e3,
|
|
55
|
-
guest_cookie_max_age_days: 9999
|
|
56
|
+
guest_cookie_max_age_days: 9999,
|
|
57
|
+
dropdown_search_max_chars: 200
|
|
56
58
|
},
|
|
57
59
|
navigation_feedback: {
|
|
58
60
|
finish_fallback_ms: 2250
|
|
@@ -79,6 +81,48 @@ var runtime_policy_generated_default = {
|
|
|
79
81
|
runtime_error_attempt_group_window_seconds: 120,
|
|
80
82
|
debug_runtime_error_preview_chars: 180
|
|
81
83
|
},
|
|
84
|
+
ai_settings: {
|
|
85
|
+
storage_authority_broadcast_dedupe_window_ms: 2e3,
|
|
86
|
+
margin_type_external_authority_ttl_ms: 12e4,
|
|
87
|
+
screener_status_refresh_delay_ms: 75,
|
|
88
|
+
preference_message_dedupe_keys: 24,
|
|
89
|
+
available_assets_retry_default_ms: 15e3,
|
|
90
|
+
available_assets_retry_min_ms: 1e3,
|
|
91
|
+
available_assets_retry_max_ms: 6e4,
|
|
92
|
+
external_sync_settle_ms: 1e3,
|
|
93
|
+
billing_stats_reuse_ms: 3e3,
|
|
94
|
+
prompt_commit_debounce_ms: 180,
|
|
95
|
+
model_count_display_settle_ms: 320,
|
|
96
|
+
model_picker_scroll_settle_ms: 60
|
|
97
|
+
},
|
|
98
|
+
ai_settings_debug: {
|
|
99
|
+
model_debug_event_limit: 160,
|
|
100
|
+
browser_resource_timings: 40,
|
|
101
|
+
browser_resource_panel_rows: 12,
|
|
102
|
+
browser_timing_refresh_delay_ms: 1500,
|
|
103
|
+
comparable_hash_full_max_chars: 16,
|
|
104
|
+
comparable_hash_edge_chars: 8,
|
|
105
|
+
console_message_chars: 4e3,
|
|
106
|
+
comparable_diff_max_depth: 4,
|
|
107
|
+
react_profile_min_duration_ms: 20,
|
|
108
|
+
react_profile_slower_margin_ms: 25,
|
|
109
|
+
react_profile_slow_update_ms: 100,
|
|
110
|
+
react_profile_repeat_interval_ms: 1500,
|
|
111
|
+
snapshot_ids_head: 10,
|
|
112
|
+
longtask_samples: 12,
|
|
113
|
+
recent_events: 20,
|
|
114
|
+
hydration_recent_events: 12,
|
|
115
|
+
dirty_state_recent_events: 12,
|
|
116
|
+
navbar_profile_entries: 30,
|
|
117
|
+
dropdown_search_paint_events: 6,
|
|
118
|
+
dropdown_options_debounce_ms: 220,
|
|
119
|
+
dropdown_hover_min_interval_ms: 80,
|
|
120
|
+
slow_render_ms: 80,
|
|
121
|
+
render_min_ms: 24,
|
|
122
|
+
render_min_interval_ms: 300,
|
|
123
|
+
model_fingerprint_head: 24,
|
|
124
|
+
models_head: 12
|
|
125
|
+
},
|
|
82
126
|
insights_charts: {
|
|
83
127
|
max_charts: 3,
|
|
84
128
|
max_line_points: 160,
|
|
@@ -98,6 +142,198 @@ var runtime_policy_generated_default = {
|
|
|
98
142
|
debug_comparable_head_chars: 240,
|
|
99
143
|
debug_panel_comparable_head_chars: 120
|
|
100
144
|
},
|
|
145
|
+
safe_mode_settings: {
|
|
146
|
+
usdc_slider_cents_steps: [
|
|
147
|
+
10,
|
|
148
|
+
25,
|
|
149
|
+
50,
|
|
150
|
+
75,
|
|
151
|
+
100,
|
|
152
|
+
150,
|
|
153
|
+
200,
|
|
154
|
+
300,
|
|
155
|
+
400,
|
|
156
|
+
500,
|
|
157
|
+
750,
|
|
158
|
+
1e3,
|
|
159
|
+
1500,
|
|
160
|
+
2e3,
|
|
161
|
+
2500,
|
|
162
|
+
3e3,
|
|
163
|
+
4e3,
|
|
164
|
+
5e3,
|
|
165
|
+
7500,
|
|
166
|
+
1e4,
|
|
167
|
+
15e3,
|
|
168
|
+
2e4,
|
|
169
|
+
25e3,
|
|
170
|
+
3e4,
|
|
171
|
+
4e4,
|
|
172
|
+
5e4,
|
|
173
|
+
75e3,
|
|
174
|
+
1e5,
|
|
175
|
+
125e3,
|
|
176
|
+
15e4,
|
|
177
|
+
2e5,
|
|
178
|
+
25e4,
|
|
179
|
+
3e5,
|
|
180
|
+
4e5,
|
|
181
|
+
5e5,
|
|
182
|
+
6e5,
|
|
183
|
+
7e5,
|
|
184
|
+
8e5,
|
|
185
|
+
9e5,
|
|
186
|
+
1e6
|
|
187
|
+
],
|
|
188
|
+
percent_input_step_bps: 1
|
|
189
|
+
},
|
|
190
|
+
copy_trading_settings: {
|
|
191
|
+
scale_multiplier_slider_thousandths_steps: [
|
|
192
|
+
10,
|
|
193
|
+
20,
|
|
194
|
+
30,
|
|
195
|
+
40,
|
|
196
|
+
50,
|
|
197
|
+
75,
|
|
198
|
+
100,
|
|
199
|
+
150,
|
|
200
|
+
200,
|
|
201
|
+
250,
|
|
202
|
+
300,
|
|
203
|
+
400,
|
|
204
|
+
500,
|
|
205
|
+
600,
|
|
206
|
+
700,
|
|
207
|
+
800,
|
|
208
|
+
850,
|
|
209
|
+
900,
|
|
210
|
+
950,
|
|
211
|
+
975,
|
|
212
|
+
1e3,
|
|
213
|
+
1025,
|
|
214
|
+
1050,
|
|
215
|
+
1100,
|
|
216
|
+
1250,
|
|
217
|
+
1500,
|
|
218
|
+
1750,
|
|
219
|
+
2e3,
|
|
220
|
+
2500,
|
|
221
|
+
3e3,
|
|
222
|
+
4e3,
|
|
223
|
+
5e3,
|
|
224
|
+
7500,
|
|
225
|
+
1e4,
|
|
226
|
+
15e3,
|
|
227
|
+
2e4,
|
|
228
|
+
3e4,
|
|
229
|
+
4e4,
|
|
230
|
+
5e4,
|
|
231
|
+
75e3,
|
|
232
|
+
1e5
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
analysis_settings: {
|
|
236
|
+
lookback_slider_candles_steps: [
|
|
237
|
+
1,
|
|
238
|
+
2,
|
|
239
|
+
3,
|
|
240
|
+
4,
|
|
241
|
+
5,
|
|
242
|
+
6,
|
|
243
|
+
7,
|
|
244
|
+
8,
|
|
245
|
+
9,
|
|
246
|
+
10,
|
|
247
|
+
12,
|
|
248
|
+
14,
|
|
249
|
+
16,
|
|
250
|
+
18,
|
|
251
|
+
20,
|
|
252
|
+
24,
|
|
253
|
+
28,
|
|
254
|
+
32,
|
|
255
|
+
36,
|
|
256
|
+
40,
|
|
257
|
+
42,
|
|
258
|
+
44,
|
|
259
|
+
48,
|
|
260
|
+
52,
|
|
261
|
+
56,
|
|
262
|
+
60,
|
|
263
|
+
65,
|
|
264
|
+
70,
|
|
265
|
+
75,
|
|
266
|
+
80,
|
|
267
|
+
90,
|
|
268
|
+
100,
|
|
269
|
+
110,
|
|
270
|
+
120,
|
|
271
|
+
130,
|
|
272
|
+
140,
|
|
273
|
+
150,
|
|
274
|
+
160,
|
|
275
|
+
180,
|
|
276
|
+
200
|
|
277
|
+
]
|
|
278
|
+
},
|
|
279
|
+
trading_limit_settings: {
|
|
280
|
+
ai_trade_amount_usdc_steps: [
|
|
281
|
+
20,
|
|
282
|
+
30,
|
|
283
|
+
40,
|
|
284
|
+
50,
|
|
285
|
+
60,
|
|
286
|
+
70,
|
|
287
|
+
80,
|
|
288
|
+
90,
|
|
289
|
+
100,
|
|
290
|
+
150,
|
|
291
|
+
175,
|
|
292
|
+
200,
|
|
293
|
+
225,
|
|
294
|
+
250,
|
|
295
|
+
275,
|
|
296
|
+
300,
|
|
297
|
+
325,
|
|
298
|
+
350,
|
|
299
|
+
375,
|
|
300
|
+
400,
|
|
301
|
+
425,
|
|
302
|
+
450,
|
|
303
|
+
475,
|
|
304
|
+
500,
|
|
305
|
+
600,
|
|
306
|
+
700,
|
|
307
|
+
800,
|
|
308
|
+
900,
|
|
309
|
+
1e3,
|
|
310
|
+
1250,
|
|
311
|
+
1500,
|
|
312
|
+
1750,
|
|
313
|
+
2e3,
|
|
314
|
+
2250,
|
|
315
|
+
2500,
|
|
316
|
+
2750,
|
|
317
|
+
3e3,
|
|
318
|
+
3250,
|
|
319
|
+
3500,
|
|
320
|
+
3750,
|
|
321
|
+
4e3,
|
|
322
|
+
4250,
|
|
323
|
+
4500,
|
|
324
|
+
4750,
|
|
325
|
+
5e3,
|
|
326
|
+
6e3,
|
|
327
|
+
7e3,
|
|
328
|
+
8e3,
|
|
329
|
+
9e3,
|
|
330
|
+
1e4
|
|
331
|
+
],
|
|
332
|
+
ai_trade_amount_max_stop_count: 50
|
|
333
|
+
},
|
|
334
|
+
calendar_settings: {
|
|
335
|
+
buffer_input_step_seconds: 30
|
|
336
|
+
},
|
|
101
337
|
debug_logs: {
|
|
102
338
|
snapshot_card_lines: 80,
|
|
103
339
|
render_debug_overlay_entries: 120,
|
|
@@ -108,7 +344,8 @@ var runtime_policy_generated_default = {
|
|
|
108
344
|
admin_text_chars: 160,
|
|
109
345
|
admin_analysis_run_id_chars: 32,
|
|
110
346
|
hyperliquid_balance_preview_count: 3,
|
|
111
|
-
model_picker_preview_count: 5
|
|
347
|
+
model_picker_preview_count: 5,
|
|
348
|
+
render_debug_entries: 250
|
|
112
349
|
},
|
|
113
350
|
history_panels: {
|
|
114
351
|
display_batch_size: 50,
|
|
@@ -116,20 +353,298 @@ var runtime_policy_generated_default = {
|
|
|
116
353
|
trade_history_fetch_page_size: 100,
|
|
117
354
|
ai_panel_interaction_window_ms: 2500,
|
|
118
355
|
ai_panel_defer_max_staleness_ms: 1e4,
|
|
119
|
-
ai_panel_defer_retry_ms: 1500
|
|
356
|
+
ai_panel_defer_retry_ms: 1500,
|
|
357
|
+
order_id_metadata_traversal_max_nodes: 400
|
|
358
|
+
},
|
|
359
|
+
trade_page: {
|
|
360
|
+
config_first_retry_delay_ms: 1e3,
|
|
361
|
+
margin_mode_min_loading_ms: 250,
|
|
362
|
+
preferences_load_retry_delay_ms_steps: [
|
|
363
|
+
1500,
|
|
364
|
+
3e3,
|
|
365
|
+
6e3,
|
|
366
|
+
12e3
|
|
367
|
+
],
|
|
368
|
+
preferences_retry_jitter_max_ms: 1500,
|
|
369
|
+
all_profile_preferences_save_delay_ms: 1500,
|
|
370
|
+
all_profile_save_interaction_window_ms: 2e3,
|
|
371
|
+
all_profile_read_concurrency: 2,
|
|
372
|
+
all_profile_ai_event_dedupe_limit: 200,
|
|
373
|
+
all_profile_order_history_limit: 50,
|
|
374
|
+
all_profile_section_timeout_min_ms: 1e3,
|
|
375
|
+
all_profile_account_summary_poll_min_ms: 1e3,
|
|
376
|
+
all_profile_trade_history_poll_min_ms: 1e3,
|
|
377
|
+
all_profile_live_refresh_idle_timeout_ms: 5e3,
|
|
378
|
+
copy_trading_message_limit: 25,
|
|
379
|
+
browser_account_refresh_min_interval_ms: 1250,
|
|
380
|
+
browser_account_watchdog_poll_min_ms: 1e4,
|
|
381
|
+
rate_limit_retry_buffer_ms: 250,
|
|
382
|
+
restricted_runtime_poll_min_ms: 3e3,
|
|
383
|
+
restricted_runtime_event_limit: 20,
|
|
384
|
+
server_account_rest_catchup_min_interval_ms: 5e3,
|
|
385
|
+
server_account_catchup_poll_min_ms: 5e3,
|
|
386
|
+
execution_rest_catchup_delay_ms_steps: [
|
|
387
|
+
2e3,
|
|
388
|
+
8e3
|
|
389
|
+
],
|
|
390
|
+
unified_bootstrap_hold_min_ms: 4e3,
|
|
391
|
+
unified_bootstrap_hold_max_ms: 8e3,
|
|
392
|
+
observed_activity_recent_ms: 8e3,
|
|
393
|
+
startup_hold_activation_gap_ms: 9e4,
|
|
394
|
+
hidden_ticker_update_interval_ms: 16,
|
|
395
|
+
client_close_fill_sync_attempts: 3,
|
|
396
|
+
client_close_fill_sync_retry_step_ms: 300,
|
|
397
|
+
leverage_update_debounce_ms: 250,
|
|
398
|
+
post_leverage_update_order_delay_ms: 250,
|
|
399
|
+
ai_control_lookback_fallback_candles: 25,
|
|
400
|
+
takeover_telemetry_error_chars: 500,
|
|
401
|
+
takeover_telemetry_error_name_chars: 120,
|
|
402
|
+
takeover_telemetry_failure_chars: 300,
|
|
403
|
+
client_next_run_interval_min_ms: 1e3,
|
|
404
|
+
ws_server_time_reorder_tolerance_ms: 1e3
|
|
405
|
+
},
|
|
406
|
+
trade_account_summary: {
|
|
407
|
+
unified_min_balances_usd: 25,
|
|
408
|
+
unified_balances_account_value_multiple: 3,
|
|
409
|
+
unified_spot_ratio_percent: 50
|
|
410
|
+
},
|
|
411
|
+
trade_debug_logs: {
|
|
412
|
+
text_chars: 180,
|
|
413
|
+
runtime_identity_tail_chars: 18,
|
|
414
|
+
run_id_chars: 8,
|
|
415
|
+
control_step_error_chars: 160,
|
|
416
|
+
control_note_chars: 120,
|
|
417
|
+
error_detail_chars: 120,
|
|
418
|
+
click_target_text_chars: 120,
|
|
419
|
+
ai_log_text_chars: 120,
|
|
420
|
+
preferences_error_chars: 160,
|
|
421
|
+
ssr_error_detail_chars: 160,
|
|
422
|
+
breadcrumb_payload_chars: 500,
|
|
423
|
+
render_debug_data_chars: 1200,
|
|
424
|
+
server_execution_value_chars: 700,
|
|
425
|
+
server_execution_error_chars: 250,
|
|
426
|
+
cost_trace_execution_debug_chars: 500,
|
|
427
|
+
positions_fetch_error_chars: 220,
|
|
428
|
+
ai_debug_lines: 100,
|
|
429
|
+
ai_model_status_lines: 100,
|
|
430
|
+
ai_model_status_shown_lines: 80,
|
|
431
|
+
ai_status_bar_trace_lines: 200,
|
|
432
|
+
ai_status_bar_trace_shown_lines: 120,
|
|
433
|
+
ai_status_bar_transition_lines: 200,
|
|
434
|
+
ai_status_bar_transition_shown_lines: 120,
|
|
435
|
+
ai_status_role_compare_lines: 240,
|
|
436
|
+
ai_status_role_compare_shown_lines: 160,
|
|
437
|
+
ai_status_bar_input_lines: 200,
|
|
438
|
+
ai_status_bar_input_shown_lines: 120,
|
|
439
|
+
ai_engine_transition_lines: 200,
|
|
440
|
+
ai_engine_transition_shown_lines: 120,
|
|
441
|
+
ai_panel_cost_lines: 120,
|
|
442
|
+
ai_panel_cost_shown_lines: 80,
|
|
443
|
+
ai_runtime_error_label_lines: 100,
|
|
444
|
+
ai_runtime_error_label_shown_lines: 80,
|
|
445
|
+
loop_status_mutation_lines: 200,
|
|
446
|
+
loop_status_mutation_shown_lines: 120,
|
|
447
|
+
login_recovery_trace_lines: 240,
|
|
448
|
+
sparkle_ownership_lines: 120,
|
|
449
|
+
ai_trader_start_lines: 100,
|
|
450
|
+
ai_trader_restart_trace_lines: 120,
|
|
451
|
+
ai_control_button_trace_lines: 240,
|
|
452
|
+
profile_status_hydration_lines: 120,
|
|
453
|
+
profile_status_hydration_shown_lines: 100,
|
|
454
|
+
cross_profile_runtime_lines: 120,
|
|
455
|
+
cross_profile_runtime_shown_lines: 80,
|
|
456
|
+
all_mode_ai_history_lines: 120,
|
|
457
|
+
positions_pnl_lines: 240,
|
|
458
|
+
positions_pnl_shown_lines: 200,
|
|
459
|
+
positions_pnl_changed_rows: 12,
|
|
460
|
+
account_state_lines: 80,
|
|
461
|
+
account_state_shown_lines: 200,
|
|
462
|
+
symbol_hydration_lines: 120,
|
|
463
|
+
trade_ui_click_lines: 200,
|
|
464
|
+
manual_close_lines: 80,
|
|
465
|
+
all_mode_interaction_lines: 160,
|
|
466
|
+
chart_render_entries: 80,
|
|
467
|
+
control_state_lines: 80,
|
|
468
|
+
runtime_network_lines: 80,
|
|
469
|
+
provider_fallback_trace_lines: 60,
|
|
470
|
+
runtime_stop_trace_lines: 80,
|
|
471
|
+
runtime_stop_breadcrumb_lines: 40,
|
|
472
|
+
prompt_contract_trace_lines: 80,
|
|
473
|
+
execution_trace_lines: 120,
|
|
474
|
+
single_history_trace_lines: 40,
|
|
475
|
+
ignored_ticker_channels: 8,
|
|
476
|
+
recent_network_targets: 8,
|
|
477
|
+
provider_failure_blocks: 6,
|
|
478
|
+
market_data_failure_blocks: 8,
|
|
479
|
+
pricing_candidates_shown: 10,
|
|
480
|
+
balance_delta_coins: 3,
|
|
481
|
+
all_mode_ai_head_messages: 5,
|
|
482
|
+
server_execution_decisions: 10,
|
|
483
|
+
server_decisions_shown: 5,
|
|
484
|
+
server_execution_refresh_ms: 1e4,
|
|
485
|
+
interaction_sample_delay_ms: 250,
|
|
486
|
+
local_breadcrumb_refresh_ms: 1e3,
|
|
487
|
+
flicker_direction_flip_window_ms: 6e3,
|
|
488
|
+
flicker_warmup_window_ms: 3e4,
|
|
489
|
+
upnl_double_count_min_cents: 50,
|
|
490
|
+
upnl_double_count_tolerance_cents: 5,
|
|
491
|
+
upnl_source_gap_min_cents: 50,
|
|
492
|
+
nonzero_upnl_jump_min_cents: 25,
|
|
493
|
+
nonzero_upnl_jump_min_relative_percent: 50,
|
|
494
|
+
nonzero_upnl_jump_min_margin_percent: 2,
|
|
495
|
+
cross_source_upnl_flicker_max_age_ms: 1e3,
|
|
496
|
+
cross_source_upnl_flicker_min_cents: 5,
|
|
497
|
+
restart_trace_manual_stop_window_minutes: 15,
|
|
498
|
+
hold_age_rounding_ms: 100,
|
|
499
|
+
account_summary_missing_trace_ms: 5e3
|
|
120
500
|
},
|
|
121
501
|
insights_access: {
|
|
122
502
|
initial_prompt_idea_count: 6,
|
|
123
503
|
section_preview_blocks: 2
|
|
124
504
|
},
|
|
125
505
|
marketing: {
|
|
126
|
-
arena_leaderboard_entries: 3
|
|
506
|
+
arena_leaderboard_entries: 3,
|
|
507
|
+
data_revalidate_seconds: 60
|
|
127
508
|
},
|
|
128
509
|
calendar: {
|
|
129
|
-
event_highlight_window_minutes: 60
|
|
510
|
+
event_highlight_window_minutes: 60,
|
|
511
|
+
search_save_debounce_ms: 250
|
|
130
512
|
},
|
|
131
513
|
system_page: {
|
|
132
|
-
hyperliquid_manual_refresh_cooldown_ms: 800
|
|
514
|
+
hyperliquid_manual_refresh_cooldown_ms: 800,
|
|
515
|
+
config_retry_initial_delay_ms: 1e3,
|
|
516
|
+
debug_api_profile_poll_ms: 500,
|
|
517
|
+
debug_save_lines: 120,
|
|
518
|
+
debug_model_sync_lines: 80,
|
|
519
|
+
debug_byok_trace_lines: 160,
|
|
520
|
+
debug_profile_delete_trace_lines: 80,
|
|
521
|
+
debug_local_ai_trace_lines: 120,
|
|
522
|
+
debug_hyperliquid_trace_lines: 120,
|
|
523
|
+
debug_oac_trace_lines: 120,
|
|
524
|
+
debug_oac_applied_state_lines: 40,
|
|
525
|
+
debug_report_trace_lines: 40,
|
|
526
|
+
debug_report_trace_line_chars: 360,
|
|
527
|
+
debug_field_value_chars: 96,
|
|
528
|
+
debug_identity_redact_max_chars: 8,
|
|
529
|
+
debug_identity_edge_chars: 4
|
|
530
|
+
},
|
|
531
|
+
analysis_page: {
|
|
532
|
+
debug_log_lines: 120
|
|
533
|
+
},
|
|
534
|
+
changelog_page: {
|
|
535
|
+
profile_search_debounce_ms: 300,
|
|
536
|
+
search_debounce_ms: 300,
|
|
537
|
+
scope_navigation_filters_max_age_ms: 3e4,
|
|
538
|
+
prompt_diff_context_lines: 3,
|
|
539
|
+
debug_event_lines: 120
|
|
540
|
+
},
|
|
541
|
+
help_page: {
|
|
542
|
+
hash_scroll_settle_ms: 250
|
|
543
|
+
},
|
|
544
|
+
history_page: {
|
|
545
|
+
preferences_save_debounce_ms: 500,
|
|
546
|
+
tracked_ws_prompt_id_count: 500,
|
|
547
|
+
ws_prompt_fingerprint_text_chars: 80,
|
|
548
|
+
load_more_visibility_percent: 10
|
|
549
|
+
},
|
|
550
|
+
leaderboard_page: {
|
|
551
|
+
debug_panel_entries: 80,
|
|
552
|
+
debug_navbar_profile_entries: 12
|
|
553
|
+
},
|
|
554
|
+
login_page: {
|
|
555
|
+
desktop_bridge_poll_ms: 250,
|
|
556
|
+
turnstile_site_key_log_chars: 10
|
|
557
|
+
},
|
|
558
|
+
screener_page: {
|
|
559
|
+
search_save_debounce_ms: 250,
|
|
560
|
+
ws_refresh_debounce_ms: 40,
|
|
561
|
+
stop_client_run_wait_checks: 30,
|
|
562
|
+
stop_client_run_wait_poll_ms: 50,
|
|
563
|
+
assignment_load_more_threshold_px: 48,
|
|
564
|
+
debug_log_lines: 160,
|
|
565
|
+
debug_runtime_events: 30,
|
|
566
|
+
debug_search_transitions: 40,
|
|
567
|
+
debug_expansion_transitions: 80,
|
|
568
|
+
debug_value_chars: 260,
|
|
569
|
+
debug_text_chars: 180,
|
|
570
|
+
debug_array_items: 20,
|
|
571
|
+
debug_event_preview_items: 12,
|
|
572
|
+
debug_snapshot_keys: 25,
|
|
573
|
+
debug_snapshot_rows: 8
|
|
574
|
+
},
|
|
575
|
+
sitemap: {
|
|
576
|
+
leaderboard_page_batch_size: 5,
|
|
577
|
+
leaderboard_max_pages: 160,
|
|
578
|
+
leaderboard_scan_attempts: 3,
|
|
579
|
+
home_priority_percent: 100,
|
|
580
|
+
team_priority_percent: 50,
|
|
581
|
+
contact_priority_percent: 50,
|
|
582
|
+
methodology_priority_percent: 80,
|
|
583
|
+
trust_priority_percent: 70,
|
|
584
|
+
insights_priority_percent: 90,
|
|
585
|
+
referrals_priority_percent: 60,
|
|
586
|
+
start_priority_percent: 80,
|
|
587
|
+
leaderboard_priority_percent: 90,
|
|
588
|
+
updates_priority_percent: 80,
|
|
589
|
+
changelog_priority_percent: 70,
|
|
590
|
+
models_priority_percent: 70,
|
|
591
|
+
calendar_priority_percent: 60,
|
|
592
|
+
help_priority_percent: 70,
|
|
593
|
+
faq_priority_percent: 70,
|
|
594
|
+
download_priority_percent: 70,
|
|
595
|
+
privacy_priority_percent: 30,
|
|
596
|
+
terms_priority_percent: 30,
|
|
597
|
+
update_post_priority_percent: 60,
|
|
598
|
+
profile_trade_priority_percent: 70,
|
|
599
|
+
profile_analytics_priority_percent: 70,
|
|
600
|
+
profile_changelog_priority_percent: 60
|
|
601
|
+
},
|
|
602
|
+
tax_page: {
|
|
603
|
+
display_batch_size: 50,
|
|
604
|
+
load_more_delay_ms: 120,
|
|
605
|
+
load_more_visibility_percent: 10,
|
|
606
|
+
selectable_year_count: 5,
|
|
607
|
+
debug_log_lines: 150
|
|
608
|
+
},
|
|
609
|
+
updates_page: {
|
|
610
|
+
post_edited_label_min_gap_ms: 6e4,
|
|
611
|
+
comment_edited_label_min_gap_ms: 2e3,
|
|
612
|
+
meta_description_chars: 160
|
|
613
|
+
},
|
|
614
|
+
social_previews: {
|
|
615
|
+
subject_max_chars: 96,
|
|
616
|
+
viewport_width: 1600,
|
|
617
|
+
viewport_height: 900,
|
|
618
|
+
chart_painted_min_px: 100,
|
|
619
|
+
chart_paint_poll_ms: 200
|
|
620
|
+
},
|
|
621
|
+
manual_order_retry: {
|
|
622
|
+
max_attempts: 2,
|
|
623
|
+
default_retry_after_milliseconds: 1500,
|
|
624
|
+
retry_after_padding_milliseconds: 200,
|
|
625
|
+
min_delay_milliseconds: 500,
|
|
626
|
+
max_delay_milliseconds: 8e3
|
|
627
|
+
},
|
|
628
|
+
api_client: {
|
|
629
|
+
get_dedupe_ttl_ms: 2e3,
|
|
630
|
+
runtime_statuses_dedupe_ttl_ms: 5e3,
|
|
631
|
+
llm_config_prime_ttl_ms: 1e4,
|
|
632
|
+
leaderboard_dedupe_ttl_ms: 2e3,
|
|
633
|
+
platform_pricing_revalidate_seconds: 300,
|
|
634
|
+
platform_pricing_timeout_ms: 2e3,
|
|
635
|
+
market_data_error_detail_chars: 240,
|
|
636
|
+
market_data_interest_error_detail_chars: 200,
|
|
637
|
+
ai_trade_history_order_id_lookup_concurrency: 4,
|
|
638
|
+
exchange_evidence_rejection_detail_chars: 200
|
|
639
|
+
},
|
|
640
|
+
interaction: {
|
|
641
|
+
debounce_ms: 250,
|
|
642
|
+
command_list_scroll_settle_ms: 60
|
|
643
|
+
},
|
|
644
|
+
model_selection: {
|
|
645
|
+
local_context_cache_ttl_hours: 12,
|
|
646
|
+
pending_local_main_selection_ttl_hours: 12,
|
|
647
|
+
pending_openai_compatible_main_selection_ttl_hours: 12
|
|
133
648
|
}
|
|
134
649
|
},
|
|
135
650
|
ai_dashboard: {
|
|
@@ -173,6 +688,10 @@ var runtime_policy_generated_default = {
|
|
|
173
688
|
]
|
|
174
689
|
},
|
|
175
690
|
defaults: {
|
|
691
|
+
calendar_settings: {
|
|
692
|
+
pre_buffer_mins: 60,
|
|
693
|
+
post_buffer_mins: 30
|
|
694
|
+
},
|
|
176
695
|
max_chat_turns: 9999
|
|
177
696
|
}
|
|
178
697
|
},
|
|
@@ -185,10 +704,14 @@ var runtime_policy_generated_default = {
|
|
|
185
704
|
network_backoff_max_seconds: 300,
|
|
186
705
|
steal_ack_timeout_ms: 5e3,
|
|
187
706
|
explicit_claim_max_waits: 3,
|
|
188
|
-
local_ai_preflight_timeout_ms: 3e3
|
|
707
|
+
local_ai_preflight_timeout_ms: 3e3,
|
|
708
|
+
wake_debounce_ms: 250,
|
|
709
|
+
claim_settle_poll_ms: 50,
|
|
710
|
+
network_backoff_exponent_max: 16
|
|
189
711
|
},
|
|
190
712
|
observability: {
|
|
191
|
-
deployment_reload_stall_warning_ms: 15e3
|
|
713
|
+
deployment_reload_stall_warning_ms: 15e3,
|
|
714
|
+
prompt_parity_error_detail_max_chars: 500
|
|
192
715
|
},
|
|
193
716
|
protective_actions: {
|
|
194
717
|
adoption_request_timeout_milliseconds: 2e4,
|
|
@@ -196,11 +719,16 @@ var runtime_policy_generated_default = {
|
|
|
196
719
|
attention_refresh_seconds: 60,
|
|
197
720
|
evidence_max_items: 32,
|
|
198
721
|
evidence_shared_read_seconds: 10,
|
|
199
|
-
retry_delay_seconds: 15
|
|
722
|
+
retry_delay_seconds: 15,
|
|
723
|
+
evidence_min_sweep_delay_milliseconds: 1e3,
|
|
724
|
+
device_sweep_max_actions: 8,
|
|
725
|
+
remaining_recheck_milliseconds: 2e3,
|
|
726
|
+
evidence_max_age_seconds: 45
|
|
200
727
|
},
|
|
201
728
|
exchange_mutation: {
|
|
202
729
|
settlement_retry_milliseconds: 1e3,
|
|
203
|
-
settlement_retry_window_seconds: 120
|
|
730
|
+
settlement_retry_window_seconds: 120,
|
|
731
|
+
reconciliation_margin_milliseconds: 250
|
|
204
732
|
},
|
|
205
733
|
protective_plan_set_lock: {
|
|
206
734
|
wait_seconds: 120
|
|
@@ -214,7 +742,8 @@ var runtime_policy_generated_default = {
|
|
|
214
742
|
device_retry_seconds: 60
|
|
215
743
|
},
|
|
216
744
|
panel_reads: {
|
|
217
|
-
device_open_orders_reuse_seconds: 2
|
|
745
|
+
device_open_orders_reuse_seconds: 2,
|
|
746
|
+
all_view_profile_concurrency: 2
|
|
218
747
|
},
|
|
219
748
|
account_stream: {
|
|
220
749
|
fill_forward_interval_ms: 1e3,
|
|
@@ -231,9 +760,56 @@ var runtime_policy_generated_default = {
|
|
|
231
760
|
ai_schedule_pause_unknown_milliseconds: 6e4,
|
|
232
761
|
provider_failure_diagnostics_delay_milliseconds: 2500,
|
|
233
762
|
provider_failure_diagnostics_max_age_milliseconds: 3e4,
|
|
234
|
-
killswitch_timer_floor_milliseconds: 1e3
|
|
763
|
+
killswitch_timer_floor_milliseconds: 1e3,
|
|
764
|
+
cycle_timeout_floor_milliseconds: 1e3,
|
|
765
|
+
decision_settlement_reserve_max_budget_divisor: 2,
|
|
766
|
+
close_fill_sync_max_attempts: 3,
|
|
767
|
+
close_fill_sync_retry_step_milliseconds: 300,
|
|
768
|
+
execution_mode_mismatch_stop_checks: 2,
|
|
769
|
+
request_bounds: {
|
|
770
|
+
min_agent_instruction_retry_after_ms: 25,
|
|
771
|
+
max_fallback_error_length: 500
|
|
772
|
+
},
|
|
773
|
+
pending_protection_recovery: {
|
|
774
|
+
retry_exponent_max: 30
|
|
775
|
+
},
|
|
776
|
+
device_diagnostics: {
|
|
777
|
+
error_cause_max_depth: 4,
|
|
778
|
+
request_path_chars: 200,
|
|
779
|
+
request_method_chars: 12,
|
|
780
|
+
error_kind_chars: 40,
|
|
781
|
+
request_id_chars: 128,
|
|
782
|
+
contract_token_prefix_chars: 12,
|
|
783
|
+
copy_trading_request_id_chars: 80,
|
|
784
|
+
copy_trading_status_chars: 80,
|
|
785
|
+
browser_platform_chars: 40,
|
|
786
|
+
breadcrumbs_max_entries: 40,
|
|
787
|
+
breadcrumb_detail_chars: 280,
|
|
788
|
+
network_debug_max_entries: 80,
|
|
789
|
+
provider_failure_debug_max_entries: 20,
|
|
790
|
+
market_data_failure_debug_max_entries: 20,
|
|
791
|
+
request_string_compact_above_chars: 500,
|
|
792
|
+
prompt_preview_chars: 220,
|
|
793
|
+
provider_failure_snapshot_max_age_seconds: 300,
|
|
794
|
+
local_provider_probe_timeout_ms: 2e3,
|
|
795
|
+
preflight_failure_reason_chars: 200,
|
|
796
|
+
host_error_note_chars: 160,
|
|
797
|
+
tick_failure_note_chars: 300,
|
|
798
|
+
auto_resume_failure_detail_chars: 500,
|
|
799
|
+
vault_migration_error_chars: 200
|
|
800
|
+
},
|
|
801
|
+
request_retry: {
|
|
802
|
+
max_attempts: 3,
|
|
803
|
+
base_delay_milliseconds: 300,
|
|
804
|
+
max_delay_milliseconds: 8e3,
|
|
805
|
+
min_retry_after_milliseconds: 250,
|
|
806
|
+
deadline_attempt_spacing_milliseconds: 250
|
|
807
|
+
}
|
|
235
808
|
},
|
|
236
809
|
server_runtime: {
|
|
810
|
+
exchange_mutation_reconciliation: {
|
|
811
|
+
protective_episode_end_fill_lookback_seconds: 120
|
|
812
|
+
},
|
|
237
813
|
prompt_rescue: {
|
|
238
814
|
request_ttl_seconds: 20,
|
|
239
815
|
snapshot_max_age_seconds: 5,
|
|
@@ -257,7 +833,9 @@ var runtime_policy_generated_default = {
|
|
|
257
833
|
max_requests_per_read: 64,
|
|
258
834
|
history_start_ms: 16409952e5,
|
|
259
835
|
device_read_deadline_seconds: 180,
|
|
260
|
-
device_recent_window_hours: 24
|
|
836
|
+
device_recent_window_hours: 24,
|
|
837
|
+
order_history_default_limit: 2e3,
|
|
838
|
+
order_history_max_limit: 2e3
|
|
261
839
|
},
|
|
262
840
|
tradability: {
|
|
263
841
|
score_min: 1,
|
|
@@ -268,12 +846,32 @@ var runtime_policy_generated_default = {
|
|
|
268
846
|
update_check_interval_ms: 144e5,
|
|
269
847
|
update_check_timeout_ms: 5e3,
|
|
270
848
|
stage_timeout_ms: 6e5,
|
|
271
|
-
startup_ready_timeout_ms: 12e4
|
|
849
|
+
startup_ready_timeout_ms: 12e4,
|
|
850
|
+
headless_claim_max_waits: 10,
|
|
851
|
+
headless_stop_request_timeout_ms: 1e4,
|
|
852
|
+
headless_max_resumes_without_a_cycle: 5,
|
|
853
|
+
headless_resume_backoff_ms_steps: [
|
|
854
|
+
1e3,
|
|
855
|
+
5e3,
|
|
856
|
+
15e3,
|
|
857
|
+
3e4,
|
|
858
|
+
6e4
|
|
859
|
+
],
|
|
860
|
+
headless_backup_first_read_retry_ms_steps: [
|
|
861
|
+
1e3,
|
|
862
|
+
5e3
|
|
863
|
+
],
|
|
864
|
+
browser_login_verifier_bytes: 32,
|
|
865
|
+
update_failure_reason_max_chars: 160,
|
|
866
|
+
update_directory_failure_reason_max_chars: 120,
|
|
867
|
+
update_plan_max_attempts: 3,
|
|
868
|
+
supervisor_max_failed_release_starts: 2
|
|
272
869
|
},
|
|
273
870
|
leaderboard: {
|
|
274
871
|
device_portfolio: {
|
|
275
872
|
device_retry_seconds: 300
|
|
276
|
-
}
|
|
873
|
+
},
|
|
874
|
+
max_page_size: 100
|
|
277
875
|
},
|
|
278
876
|
external_inference: {
|
|
279
877
|
service: {
|
|
@@ -291,6 +889,13 @@ var runtime_policy_generated_default = {
|
|
|
291
889
|
update_readiness_timeout_ms: 6e5,
|
|
292
890
|
rollback_confirmation_min_attempts: 100,
|
|
293
891
|
ready_consecutive_observations: 2,
|
|
892
|
+
update_attempts: 3,
|
|
893
|
+
update_retry_interval_ms: 2e3,
|
|
894
|
+
update_failure_reason_max_chars: 160,
|
|
895
|
+
launcher_poll_interval_ms: 100,
|
|
896
|
+
log_tail_default_lines: 100,
|
|
897
|
+
worker_output_line_max_chars: 4096,
|
|
898
|
+
worker_stdout_tail_max_chars: 65536,
|
|
294
899
|
control_lock_wait_attempts: 400,
|
|
295
900
|
control_lock_retry_interval_ms: 250,
|
|
296
901
|
supervisor_manifest_poll_interval_ms: 250,
|
|
@@ -299,6 +904,44 @@ var runtime_policy_generated_default = {
|
|
|
299
904
|
claim_diagnostics: {
|
|
300
905
|
event_loop_sample_interval_ms: 100
|
|
301
906
|
},
|
|
907
|
+
host_core: {
|
|
908
|
+
oauth_request_timeout_ms: 15e3,
|
|
909
|
+
oauth_revocation_timeout_ms: 5e3,
|
|
910
|
+
oauth_login_timeout_ms: 6e5,
|
|
911
|
+
mcp_request_timeout_ms: 15e3,
|
|
912
|
+
mcp_retry_after_max_ms: 864e5,
|
|
913
|
+
credential_command_timeout_ms: 15e3,
|
|
914
|
+
credential_command_termination_timeout_ms: 5e3,
|
|
915
|
+
credential_command_output_max_bytes: 1048576,
|
|
916
|
+
private_file_max_bytes: 16777216,
|
|
917
|
+
private_file_replace_attempts: 40,
|
|
918
|
+
private_file_replace_retry_delay_ms: 25,
|
|
919
|
+
atomic_replacement_read_attempts: 3,
|
|
920
|
+
owned_directory_removal_attempts: 10,
|
|
921
|
+
owned_directory_removal_retry_step_ms: 100,
|
|
922
|
+
identity_command_timeout_ms: 5e3,
|
|
923
|
+
identity_command_output_max_bytes: 4096,
|
|
924
|
+
windows_identity_command_timeout_ms: 15e3,
|
|
925
|
+
windows_process_identity_output_max_bytes: 1024,
|
|
926
|
+
windows_acl_broker_startup_timeout_ms: 9e4,
|
|
927
|
+
windows_acl_broker_request_timeout_ms: 15e3,
|
|
928
|
+
windows_acl_broker_idle_shutdown_ms: 3e4,
|
|
929
|
+
windows_acl_broker_kill_grace_ms: 1e3,
|
|
930
|
+
windows_acl_broker_request_max_bytes: 65536,
|
|
931
|
+
windows_acl_broker_output_max_chars: 65536,
|
|
932
|
+
windows_acl_broker_response_line_max_chars: 4096,
|
|
933
|
+
process_lock_publication_grace_ms: 1e4,
|
|
934
|
+
process_lock_record_max_bytes: 65536,
|
|
935
|
+
process_lock_guard_election_lease_ms: 5e3,
|
|
936
|
+
process_lock_guard_election_stale_ms: 3e4,
|
|
937
|
+
process_lock_guard_election_attempts: 8,
|
|
938
|
+
process_lock_guard_election_backoff_ms: 10,
|
|
939
|
+
process_lock_guard_election_backoff_exponent_max: 4,
|
|
940
|
+
process_lock_identity_cache_ms: 5e3
|
|
941
|
+
},
|
|
942
|
+
agent_control: {
|
|
943
|
+
max_turn_decision_operation_ids: 128
|
|
944
|
+
},
|
|
302
945
|
host_runtime: {
|
|
303
946
|
advertisement_ttl_ms: 12e4,
|
|
304
947
|
advertisement_refresh_lead_ms: 3e4,
|
|
@@ -307,6 +950,9 @@ var runtime_policy_generated_default = {
|
|
|
307
950
|
agent_heartbeat_interval_ms: 3e3,
|
|
308
951
|
agent_heartbeat_max_retry_delay_ms: 9e3,
|
|
309
952
|
provider_rate_limit_refresh_ms: 6e4,
|
|
953
|
+
provider_quota_recovery_max_age_refresh_intervals: 2,
|
|
954
|
+
model_catalog_read_lead_divisor: 2,
|
|
955
|
+
agent_wake_summary_max_chars: 2e3,
|
|
310
956
|
drain_timeout_ms: 3e4,
|
|
311
957
|
remote_retry_limit: 3,
|
|
312
958
|
minimum_sleep_ms: 10,
|
|
@@ -331,10 +977,72 @@ var runtime_policy_generated_default = {
|
|
|
331
977
|
agent_turn_timeout_ms: 6e5,
|
|
332
978
|
codex_rate_limit_metadata_timeout_ms: 5e3,
|
|
333
979
|
codex_login_timeout_ms: 9e5,
|
|
334
|
-
codex_command_timeout_ms: 3e4
|
|
980
|
+
codex_command_timeout_ms: 3e4,
|
|
981
|
+
cli_wait_default_seconds: 50,
|
|
982
|
+
cli_wait_max_seconds: 300,
|
|
983
|
+
cli_log_lines_default: 100,
|
|
984
|
+
cli_log_lines_max: 1e4,
|
|
985
|
+
service_control_input_max_chars: 4096,
|
|
986
|
+
codex_auth_file_max_bytes: 8388608,
|
|
987
|
+
agent_stdin_max_bytes: 1e6,
|
|
988
|
+
agent_next_poll_min_ms: 50,
|
|
989
|
+
agent_assignment_poll_min_ms: 250,
|
|
990
|
+
agent_assignment_poll_fallback_ms: 1e3,
|
|
991
|
+
agent_assignment_poll_max_ms: 5e3,
|
|
992
|
+
codex_recovery_scan_max_entries: 2e4,
|
|
993
|
+
codex_recovery_scan_max_depth: 12,
|
|
994
|
+
codex_recovery_thread_file_max_bytes: 33554432,
|
|
995
|
+
codex_recovery_thread_scan_lines: 128,
|
|
996
|
+
codex_quiescence_proof_max_age_ms: 3e4,
|
|
997
|
+
codex_quiescence_proof_clock_skew_ms: 1e3,
|
|
998
|
+
codex_guardian_start_timeout_ms: 1e4,
|
|
999
|
+
codex_guardian_termination_timeout_ms: 5e3,
|
|
1000
|
+
codex_guardian_termination_deadline_min_ms: 25,
|
|
1001
|
+
codex_guardian_state_poll_ms: 25,
|
|
1002
|
+
codex_guardian_shutdown_grace_ms: 2e3,
|
|
1003
|
+
codex_guardian_shutdown_grace_min_ms: 25,
|
|
1004
|
+
codex_guardian_receipt_replace_attempts: 40,
|
|
1005
|
+
codex_guardian_receipt_replace_retry_ms: 25,
|
|
1006
|
+
codex_diagnostic_attempt_ids_max: 64,
|
|
1007
|
+
codex_retired_response_ids_max: 256,
|
|
1008
|
+
codex_stderr_classification_tail_chars: 1024,
|
|
1009
|
+
codex_request_timeout_ms: 3e4,
|
|
1010
|
+
codex_interrupt_timeout_ms: 5e3,
|
|
1011
|
+
codex_login_cancel_timeout_ms: 5e3,
|
|
1012
|
+
codex_close_exit_timeout_ms: 5e3,
|
|
1013
|
+
codex_close_terminate_timeout_ms: 1e3,
|
|
1014
|
+
codex_close_kill_timeout_ms: 1e3,
|
|
1015
|
+
codex_process_tree_cleanup_timeout_ms: 5e3,
|
|
1016
|
+
binary_version_probe_timeout_ms: 1e4,
|
|
1017
|
+
binary_version_probe_stdout_max_chars: 1024,
|
|
1018
|
+
codex_version_probe_stderr_max_bytes: 65536,
|
|
1019
|
+
codex_recovery_process_observations: 2,
|
|
1020
|
+
codex_recovery_process_observation_interval_ms: 250,
|
|
1021
|
+
codex_recovery_process_query_stdout_max_chars: 4e6,
|
|
1022
|
+
codex_recovery_process_query_stderr_max_chars: 4096,
|
|
1023
|
+
deepseek_transport_request_max_bytes: 8388608,
|
|
1024
|
+
exo_command_output_max_bytes: 4e6,
|
|
1025
|
+
exo_git_output_max_chars: 2e5,
|
|
1026
|
+
exo_bridge_request_max_bytes: 2e6,
|
|
1027
|
+
exo_bridge_request_timeout_ms: 3e4,
|
|
1028
|
+
exo_provider_retry_after_max_ms: 864e5,
|
|
1029
|
+
grok_preflight_timeout_ms: 3e4,
|
|
1030
|
+
grok_login_timeout_ms: 9e5,
|
|
1031
|
+
grok_command_timeout_ms: 3e4,
|
|
1032
|
+
grok_auth_output_max_bytes: 65536,
|
|
1033
|
+
grok_binary_max_bytes: 536870912,
|
|
1034
|
+
grok_acp_message_max_bytes: 2e6,
|
|
1035
|
+
grok_close_kill_delay_ms: 1500,
|
|
1036
|
+
grok_mcp_request_max_bytes: 3e5,
|
|
1037
|
+
grok_cwd_marker_max_bytes: 32768,
|
|
1038
|
+
grok_session_summary_max_bytes: 1048576,
|
|
1039
|
+
provider_error_body_timeout_ms: 1e3,
|
|
1040
|
+
provider_error_body_max_bytes: 16384,
|
|
1041
|
+
pi_receipt_event_max_chars: 2e6
|
|
335
1042
|
},
|
|
336
1043
|
quota_membership_cooldown_seconds: 300,
|
|
337
|
-
transient_membership_cooldown_seconds: 30
|
|
1044
|
+
transient_membership_cooldown_seconds: 30,
|
|
1045
|
+
runtime_poll_interval_milliseconds: 250
|
|
338
1046
|
},
|
|
339
1047
|
desktop: {
|
|
340
1048
|
runtime_watchdog: {
|
|
@@ -350,6 +1058,16 @@ var runtime_policy_generated_default = {
|
|
|
350
1058
|
client_lock_ttl_milliseconds: 12e4,
|
|
351
1059
|
client_poll_interval_milliseconds: 250
|
|
352
1060
|
},
|
|
1061
|
+
ui_bounds: {
|
|
1062
|
+
screener_min_volume_usd_max: 1e9
|
|
1063
|
+
},
|
|
1064
|
+
runtime: {
|
|
1065
|
+
assignment_page_default_limit: 20,
|
|
1066
|
+
client_candidate_owner_lease_grace_ms: 6e4,
|
|
1067
|
+
client_server_heartbeats_per_owner_lease: 2,
|
|
1068
|
+
client_server_heartbeat_min_ms: 5e3,
|
|
1069
|
+
client_server_heartbeat_max_ms: 3e4
|
|
1070
|
+
},
|
|
353
1071
|
defaults: {
|
|
354
1072
|
adaptive_schedule_enabled: true
|
|
355
1073
|
}
|
|
@@ -483,6 +1201,9 @@ var runtime_policy_generated_default = {
|
|
|
483
1201
|
tokens: {
|
|
484
1202
|
email_2fa_code_length: 6,
|
|
485
1203
|
totp_code_length: 6
|
|
1204
|
+
},
|
|
1205
|
+
passwords: {
|
|
1206
|
+
min_length: 12
|
|
486
1207
|
}
|
|
487
1208
|
},
|
|
488
1209
|
android: {
|
|
@@ -523,6 +1244,14 @@ var runtime_policy_generated_default = {
|
|
|
523
1244
|
handle_change_window_days: 14
|
|
524
1245
|
}
|
|
525
1246
|
},
|
|
1247
|
+
copy_trading: {
|
|
1248
|
+
source_search: {
|
|
1249
|
+
min_query_length: 2
|
|
1250
|
+
},
|
|
1251
|
+
runtime: {
|
|
1252
|
+
client_account_mode_cache_budget_divisor: 2
|
|
1253
|
+
}
|
|
1254
|
+
},
|
|
526
1255
|
billing: {
|
|
527
1256
|
credit_purchase: {
|
|
528
1257
|
amount_usd_steps: [
|
|
@@ -562,6 +1291,22 @@ var runtime_policy_generated_default = {
|
|
|
562
1291
|
min_query_length: 2
|
|
563
1292
|
}
|
|
564
1293
|
},
|
|
1294
|
+
profile_setting_changelog: {
|
|
1295
|
+
public_profile_search_limit: 10,
|
|
1296
|
+
page_default_limit: 50
|
|
1297
|
+
},
|
|
1298
|
+
history: {
|
|
1299
|
+
full_history_default_limit: 20,
|
|
1300
|
+
default_page_size: 50,
|
|
1301
|
+
trade_lookup_max_order_ids: 200,
|
|
1302
|
+
decision_batch_default_limit: 50
|
|
1303
|
+
},
|
|
1304
|
+
updates: {
|
|
1305
|
+
posts: {
|
|
1306
|
+
list_default_limit: 20,
|
|
1307
|
+
list_max_limit: 100
|
|
1308
|
+
}
|
|
1309
|
+
},
|
|
565
1310
|
security: {
|
|
566
1311
|
byok: {
|
|
567
1312
|
max_provider_keys_per_provider: 5
|
|
@@ -578,10 +1323,58 @@ var runtime_policy_generated_default = {
|
|
|
578
1323
|
}
|
|
579
1324
|
},
|
|
580
1325
|
referrals: {
|
|
581
|
-
code_max_length: 24
|
|
1326
|
+
code_max_length: 24,
|
|
1327
|
+
dashboard_default_limit: 20
|
|
1328
|
+
},
|
|
1329
|
+
insights: {
|
|
1330
|
+
client_host: {
|
|
1331
|
+
device_read_default_result_bytes: 2e5
|
|
1332
|
+
}
|
|
1333
|
+
},
|
|
1334
|
+
agent_tokens: {
|
|
1335
|
+
browser_login_ttl_seconds: 600,
|
|
1336
|
+
browser_login_poll_interval_seconds: 2
|
|
582
1337
|
}
|
|
583
1338
|
};
|
|
584
1339
|
|
|
1340
|
+
// lib/constants.ts
|
|
1341
|
+
var MS_PER_SECOND = 1e3;
|
|
1342
|
+
var SECONDS_PER_MINUTE = 60;
|
|
1343
|
+
var MINUTES_PER_HOUR = 60;
|
|
1344
|
+
var HOURS_PER_DAY = 24;
|
|
1345
|
+
var DAYS_PER_WEEK = 7;
|
|
1346
|
+
var MS_PER_MINUTE = MS_PER_SECOND * SECONDS_PER_MINUTE;
|
|
1347
|
+
var SECONDS_PER_HOUR = SECONDS_PER_MINUTE * MINUTES_PER_HOUR;
|
|
1348
|
+
var SECONDS_PER_DAY = SECONDS_PER_HOUR * HOURS_PER_DAY;
|
|
1349
|
+
var SECONDS_PER_WEEK = SECONDS_PER_DAY * DAYS_PER_WEEK;
|
|
1350
|
+
var MINUTES_PER_DAY = MINUTES_PER_HOUR * HOURS_PER_DAY;
|
|
1351
|
+
var MINUTES_PER_WEEK = MINUTES_PER_DAY * DAYS_PER_WEEK;
|
|
1352
|
+
var MS_PER_HOUR = MS_PER_MINUTE * MINUTES_PER_HOUR;
|
|
1353
|
+
var MS_PER_DAY = MS_PER_HOUR * HOURS_PER_DAY;
|
|
1354
|
+
var READ_STAMP_TIE_MS = MS_PER_SECOND / 1e6;
|
|
1355
|
+
var BACKOFF_GROWTH_FACTOR = 2;
|
|
1356
|
+
var BYTES_PER_KIB = 1024;
|
|
1357
|
+
var BYTES_PER_MIB = BYTES_PER_KIB * BYTES_PER_KIB;
|
|
1358
|
+
var OWNER_ONLY_FILE_MODE = 384;
|
|
1359
|
+
var OWNER_ONLY_DIRECTORY_MODE = 448;
|
|
1360
|
+
var GROUP_OTHER_PERMISSION_BITS = 63;
|
|
1361
|
+
var INT32_MIN = -(2 ** 31);
|
|
1362
|
+
var INT32_MAX = 2 ** 31 - 1;
|
|
1363
|
+
var AI_COST_ESTIMATE_PERIOD_DAYS = 30;
|
|
1364
|
+
var SECONDS_PER_AI_COST_ESTIMATE_PERIOD = SECONDS_PER_DAY * AI_COST_ESTIMATE_PERIOD_DAYS;
|
|
1365
|
+
var EXIT_CODE_TEMPFAIL = 75;
|
|
1366
|
+
var INFERENCE_HOST_PROCESS_LOCK_RECORD_SCHEMA_VERSION = 2;
|
|
1367
|
+
var INFERENCE_HOST_RECLAIM_GUARD_CREATE_PASSES = 2;
|
|
1368
|
+
var LINUX_PROC_STAT_COMM_TERMINATOR_CHARS = 2;
|
|
1369
|
+
var INFERENCE_HOST_RANDOM_BYTES = {
|
|
1370
|
+
TEMP_FILE_SUFFIX: 12,
|
|
1371
|
+
LOCK_BALLOT_NAME: 16,
|
|
1372
|
+
LOCK_TOKEN: 24,
|
|
1373
|
+
OAUTH_PKCE_VERIFIER: 48,
|
|
1374
|
+
OAUTH_STATE: 32,
|
|
1375
|
+
OAUTH_CALLBACK_PATH: 16
|
|
1376
|
+
};
|
|
1377
|
+
|
|
585
1378
|
// lib/inference-host/service-launcher.ts
|
|
586
1379
|
import { spawn as spawn2 } from "node:child_process";
|
|
587
1380
|
import { appendFile, readFile as readFile3, rm as rm3 } from "node:fs/promises";
|
|
@@ -595,13 +1388,14 @@ import { constants } from "node:fs";
|
|
|
595
1388
|
import { lstat, mkdir, open, readdir, readFile, realpath, rename, rm } from "node:fs/promises";
|
|
596
1389
|
import { homedir } from "node:os";
|
|
597
1390
|
import { basename, dirname, isAbsolute, join, relative, resolve, win32 as windowsPath } from "node:path";
|
|
1391
|
+
var HOST_CORE_POLICY = runtime_policy_generated_default.external_inference.host_core;
|
|
598
1392
|
var InferenceHostProcessLockBusyError = class extends Error {
|
|
599
1393
|
constructor() {
|
|
600
1394
|
super("Another inference host process already owns this local host.");
|
|
601
1395
|
this.name = "InferenceHostProcessLockBusyError";
|
|
602
1396
|
}
|
|
603
1397
|
};
|
|
604
|
-
var MAX_INFERENCE_PRIVATE_FILE_BYTES =
|
|
1398
|
+
var MAX_INFERENCE_PRIVATE_FILE_BYTES = HOST_CORE_POLICY.private_file_max_bytes;
|
|
605
1399
|
var WINDOWS_PRIVATE_ACL_MODES = ["harden", "verify", "verify-owner", "verify-private"];
|
|
606
1400
|
var WINDOWS_PRIVATE_ACL_BROKER_SCRIPT = `$ErrorActionPreference='Stop'
|
|
607
1401
|
$ProgressPreference='SilentlyContinue'
|
|
@@ -609,7 +1403,7 @@ while(($line=[Console]::In.ReadLine()) -ne $null) {
|
|
|
609
1403
|
$requestId=$null
|
|
610
1404
|
$failureStage='request_validation'
|
|
611
1405
|
try {
|
|
612
|
-
if($line.Length -lt 2 -or $line.Length -gt
|
|
1406
|
+
if($line.Length -lt 2 -or $line.Length -gt ${HOST_CORE_POLICY.windows_acl_broker_request_max_bytes}) { throw 'invalid request size' }
|
|
613
1407
|
$request=$line | ConvertFrom-Json
|
|
614
1408
|
$names=@($request.PSObject.Properties.Name | Sort-Object)
|
|
615
1409
|
if(($names -join ',') -ne 'id,kind,mode,path_b64') { throw 'invalid request shape' }
|
|
@@ -685,9 +1479,9 @@ while(($line=[Console]::In.ReadLine()) -ne $null) {
|
|
|
685
1479
|
[Console]::Out.WriteLine((@{id=$requestId;status='error';error_code=$failureStage} | ConvertTo-Json -Compress))
|
|
686
1480
|
}
|
|
687
1481
|
}`;
|
|
688
|
-
var WINDOWS_IDENTITY_COMMAND_TIMEOUT_MS =
|
|
689
|
-
var WINDOWS_PRIVATE_ACL_BROKER_STARTUP_TIMEOUT_MS =
|
|
690
|
-
var SMALL_IDENTITY_COMMAND_TIMEOUT_MS =
|
|
1482
|
+
var WINDOWS_IDENTITY_COMMAND_TIMEOUT_MS = HOST_CORE_POLICY.windows_identity_command_timeout_ms;
|
|
1483
|
+
var WINDOWS_PRIVATE_ACL_BROKER_STARTUP_TIMEOUT_MS = HOST_CORE_POLICY.windows_acl_broker_startup_timeout_ms;
|
|
1484
|
+
var SMALL_IDENTITY_COMMAND_TIMEOUT_MS = HOST_CORE_POLICY.identity_command_timeout_ms;
|
|
691
1485
|
var windowsPowerShellEnvironment = (extra = {}) => {
|
|
692
1486
|
const sanitizedExtra = { ...extra };
|
|
693
1487
|
delete sanitizedExtra.PSModulePath;
|
|
@@ -730,9 +1524,9 @@ var WindowsPrivateAclBroker = class {
|
|
|
730
1524
|
this.queue = operation.then(() => void 0, () => void 0);
|
|
731
1525
|
await operation;
|
|
732
1526
|
};
|
|
733
|
-
this.requestTimeoutMs = dependencies.requestTimeoutMs ??
|
|
1527
|
+
this.requestTimeoutMs = dependencies.requestTimeoutMs ?? HOST_CORE_POLICY.windows_acl_broker_request_timeout_ms;
|
|
734
1528
|
this.startupRequestTimeoutMs = dependencies.startupRequestTimeoutMs ?? WINDOWS_PRIVATE_ACL_BROKER_STARTUP_TIMEOUT_MS;
|
|
735
|
-
this.idleShutdownMs = dependencies.idleShutdownMs ??
|
|
1529
|
+
this.idleShutdownMs = dependencies.idleShutdownMs ?? HOST_CORE_POLICY.windows_acl_broker_idle_shutdown_ms;
|
|
736
1530
|
this.spawnProcess = dependencies.spawnProcess ?? (() => {
|
|
737
1531
|
const invocation = windowsPrivateAclBrokerInvocation();
|
|
738
1532
|
return spawn("powershell.exe", [...invocation.args], {
|
|
@@ -751,7 +1545,7 @@ var WindowsPrivateAclBroker = class {
|
|
|
751
1545
|
this.child = null;
|
|
752
1546
|
this.outputBuffer = "";
|
|
753
1547
|
child.stdin.end();
|
|
754
|
-
const force = setTimeout(() => child.kill("SIGKILL"),
|
|
1548
|
+
const force = setTimeout(() => child.kill("SIGKILL"), HOST_CORE_POLICY.windows_acl_broker_kill_grace_ms);
|
|
755
1549
|
force.unref();
|
|
756
1550
|
child.once("exit", () => clearTimeout(force));
|
|
757
1551
|
}, this.idleShutdownMs);
|
|
@@ -775,7 +1569,7 @@ var WindowsPrivateAclBroker = class {
|
|
|
775
1569
|
}
|
|
776
1570
|
acceptLine(child, line) {
|
|
777
1571
|
const pending = this.pending;
|
|
778
|
-
if (!pending || !line || line.length >
|
|
1572
|
+
if (!pending || !line || line.length > HOST_CORE_POLICY.windows_acl_broker_response_line_max_chars) {
|
|
779
1573
|
this.failChild(child, new Error("Windows private ACL broker returned malformed output."));
|
|
780
1574
|
return;
|
|
781
1575
|
}
|
|
@@ -826,7 +1620,7 @@ var WindowsPrivateAclBroker = class {
|
|
|
826
1620
|
child.stdout.on("data", (chunk) => {
|
|
827
1621
|
if (this.child !== child) return;
|
|
828
1622
|
this.outputBuffer += chunk;
|
|
829
|
-
if (this.outputBuffer.length >
|
|
1623
|
+
if (this.outputBuffer.length > HOST_CORE_POLICY.windows_acl_broker_output_max_chars) {
|
|
830
1624
|
this.failChild(child, new Error("Windows private ACL broker exceeded its output limit."));
|
|
831
1625
|
return;
|
|
832
1626
|
}
|
|
@@ -864,7 +1658,7 @@ var WindowsPrivateAclBroker = class {
|
|
|
864
1658
|
path_b64: Buffer.from(path, "utf8").toString("base64")
|
|
865
1659
|
})}
|
|
866
1660
|
`;
|
|
867
|
-
if (Buffer.byteLength(request, "utf8") >
|
|
1661
|
+
if (Buffer.byteLength(request, "utf8") > HOST_CORE_POLICY.windows_acl_broker_request_max_bytes) {
|
|
868
1662
|
throw new Error("Windows private ACL broker request exceeds its input limit.");
|
|
869
1663
|
}
|
|
870
1664
|
const { child, startedNow } = this.ensureChild();
|
|
@@ -968,7 +1762,7 @@ var linuxProcessIdentity = async (pid) => {
|
|
|
968
1762
|
readFile("/proc/sys/kernel/random/boot_id", "utf8"),
|
|
969
1763
|
readFile(`/proc/${pid}/stat`, "utf8")
|
|
970
1764
|
]);
|
|
971
|
-
const fields = statLine.slice(statLine.lastIndexOf(")") +
|
|
1765
|
+
const fields = statLine.slice(statLine.lastIndexOf(")") + LINUX_PROC_STAT_COMM_TERMINATOR_CHARS).trim().split(/\s+/u);
|
|
972
1766
|
const startTicks = fields[19];
|
|
973
1767
|
return startTicks ? `linux:${bootId.trim()}:${startTicks}` : null;
|
|
974
1768
|
} catch {
|
|
@@ -1023,7 +1817,7 @@ var windowsProcessIdentity = async (pid) => await new Promise((resolvePromise) =
|
|
|
1023
1817
|
settle(null);
|
|
1024
1818
|
}, invocation.timeoutMs);
|
|
1025
1819
|
child.stdout.on("data", (chunk) => {
|
|
1026
|
-
if (output.reduce((total, item) => total + item.byteLength, 0) + Buffer.byteLength(chunk) >
|
|
1820
|
+
if (output.reduce((total, item) => total + item.byteLength, 0) + Buffer.byteLength(chunk) > HOST_CORE_POLICY.windows_process_identity_output_max_bytes) {
|
|
1027
1821
|
child.kill("SIGKILL");
|
|
1028
1822
|
settle(null);
|
|
1029
1823
|
return;
|
|
@@ -1051,12 +1845,12 @@ var darwinProcessIdentity = async (pid) => await new Promise((resolvePromise) =>
|
|
|
1051
1845
|
const timer = setTimeout(() => {
|
|
1052
1846
|
child.kill("SIGKILL");
|
|
1053
1847
|
settle(null);
|
|
1054
|
-
},
|
|
1848
|
+
}, SMALL_IDENTITY_COMMAND_TIMEOUT_MS);
|
|
1055
1849
|
child.stdout.on("data", (chunk) => output.push(Buffer.from(chunk)));
|
|
1056
1850
|
child.once("error", () => settle(null));
|
|
1057
1851
|
child.once("exit", (code) => {
|
|
1058
1852
|
const started = Date.parse(Buffer.concat(output).toString("utf8").trim());
|
|
1059
|
-
settle(code === 0 && Number.isFinite(started) ? `darwin:${Math.floor(started /
|
|
1853
|
+
settle(code === 0 && Number.isFinite(started) ? `darwin:${Math.floor(started / MS_PER_SECOND)}` : null);
|
|
1060
1854
|
});
|
|
1061
1855
|
});
|
|
1062
1856
|
var runSmallIdentityCommand = async (command, args, env, timeoutMs = SMALL_IDENTITY_COMMAND_TIMEOUT_MS) => await new Promise((resolvePromise) => {
|
|
@@ -1080,7 +1874,7 @@ var runSmallIdentityCommand = async (command, args, env, timeoutMs = SMALL_IDENT
|
|
|
1080
1874
|
}, timeoutMs);
|
|
1081
1875
|
child.stdout.on("data", (chunk) => {
|
|
1082
1876
|
bytes += Buffer.byteLength(chunk);
|
|
1083
|
-
if (bytes >
|
|
1877
|
+
if (bytes > HOST_CORE_POLICY.identity_command_output_max_bytes) {
|
|
1084
1878
|
child.kill("SIGKILL");
|
|
1085
1879
|
settle(null);
|
|
1086
1880
|
return;
|
|
@@ -1167,7 +1961,7 @@ async function ensureInferencePrivateDirectory(path, dependencies = {}) {
|
|
|
1167
1961
|
}
|
|
1168
1962
|
} catch (error) {
|
|
1169
1963
|
if (error.code !== "ENOENT") throw error;
|
|
1170
|
-
await mkdir(path, { recursive: true, mode:
|
|
1964
|
+
await mkdir(path, { recursive: true, mode: OWNER_ONLY_DIRECTORY_MODE });
|
|
1171
1965
|
created = true;
|
|
1172
1966
|
}
|
|
1173
1967
|
const after = await lstat(path);
|
|
@@ -1188,7 +1982,7 @@ async function ensureInferencePrivateDirectory(path, dependencies = {}) {
|
|
|
1188
1982
|
}
|
|
1189
1983
|
return;
|
|
1190
1984
|
}
|
|
1191
|
-
if ((after.mode &
|
|
1985
|
+
if ((after.mode & GROUP_OTHER_PERMISSION_BITS) !== 0) {
|
|
1192
1986
|
throw new Error("Inference host state directory must have mode 0700.");
|
|
1193
1987
|
}
|
|
1194
1988
|
if (typeof process.getuid === "function" && after.uid !== process.getuid()) {
|
|
@@ -1219,8 +2013,8 @@ async function replaceAtomicInferencePrivateFile(temporaryPath, destinationPath,
|
|
|
1219
2013
|
const platform = options.platform ?? process.platform;
|
|
1220
2014
|
const renameFile = options.renameFile ?? rename;
|
|
1221
2015
|
const sleep = options.sleep ?? ((milliseconds) => new Promise((resolve4) => setTimeout(resolve4, milliseconds)));
|
|
1222
|
-
const maxAttempts = Math.max(1, options.maxAttempts ??
|
|
1223
|
-
const retryDelayMs = Math.max(0, options.retryDelayMs ??
|
|
2016
|
+
const maxAttempts = Math.max(1, options.maxAttempts ?? HOST_CORE_POLICY.private_file_replace_attempts);
|
|
2017
|
+
const retryDelayMs = Math.max(0, options.retryDelayMs ?? HOST_CORE_POLICY.private_file_replace_retry_delay_ms);
|
|
1224
2018
|
for (let attempt = 0; attempt < maxAttempts; attempt += 1) {
|
|
1225
2019
|
try {
|
|
1226
2020
|
await renameFile(temporaryPath, destinationPath);
|
|
@@ -1246,12 +2040,12 @@ async function writeAtomicInferencePrivateFile(path, contents, dependencies = {}
|
|
|
1246
2040
|
}
|
|
1247
2041
|
const temporary = join(
|
|
1248
2042
|
directory,
|
|
1249
|
-
`.${process.pid}.${randomBytes(
|
|
2043
|
+
`.${process.pid}.${randomBytes(INFERENCE_HOST_RANDOM_BYTES.TEMP_FILE_SUFFIX).toString("hex")}.tmp`
|
|
1250
2044
|
);
|
|
1251
2045
|
const handle = await open(
|
|
1252
2046
|
temporary,
|
|
1253
2047
|
constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY | constants.O_NOFOLLOW,
|
|
1254
|
-
|
|
2048
|
+
OWNER_ONLY_FILE_MODE
|
|
1255
2049
|
);
|
|
1256
2050
|
try {
|
|
1257
2051
|
await handle.writeFile(contents, "utf8");
|
|
@@ -1300,12 +2094,12 @@ async function writeAtomicInferencePrivateFile(path, contents, dependencies = {}
|
|
|
1300
2094
|
throw error;
|
|
1301
2095
|
}
|
|
1302
2096
|
}
|
|
1303
|
-
var PROCESS_LOCK_PUBLICATION_GRACE_MS =
|
|
1304
|
-
var PROCESS_LOCK_MAX_RECORD_BYTES =
|
|
1305
|
-
var PROCESS_LOCK_GUARD_ELECTION_LEASE_MS =
|
|
1306
|
-
var PROCESS_LOCK_GUARD_ELECTION_STALE_MS =
|
|
1307
|
-
var PROCESS_LOCK_GUARD_ELECTION_ATTEMPTS =
|
|
1308
|
-
var PROCESS_LOCK_GUARD_ELECTION_BACKOFF_MS =
|
|
2097
|
+
var PROCESS_LOCK_PUBLICATION_GRACE_MS = HOST_CORE_POLICY.process_lock_publication_grace_ms;
|
|
2098
|
+
var PROCESS_LOCK_MAX_RECORD_BYTES = HOST_CORE_POLICY.process_lock_record_max_bytes;
|
|
2099
|
+
var PROCESS_LOCK_GUARD_ELECTION_LEASE_MS = HOST_CORE_POLICY.process_lock_guard_election_lease_ms;
|
|
2100
|
+
var PROCESS_LOCK_GUARD_ELECTION_STALE_MS = HOST_CORE_POLICY.process_lock_guard_election_stale_ms;
|
|
2101
|
+
var PROCESS_LOCK_GUARD_ELECTION_ATTEMPTS = HOST_CORE_POLICY.process_lock_guard_election_attempts;
|
|
2102
|
+
var PROCESS_LOCK_GUARD_ELECTION_BACKOFF_MS = HOST_CORE_POLICY.process_lock_guard_election_backoff_ms;
|
|
1309
2103
|
var PROCESS_LOCK_LABEL = "Inference host process lock";
|
|
1310
2104
|
var PROCESS_LOCK_GUARD_LABEL = "Inference host process lock reclamation guard";
|
|
1311
2105
|
var sameProcessLockFile = (left, right) => left.dev === right.dev && left.ino === right.ino && left.size === right.size && left.mtimeMs === right.mtimeMs && left.ctimeMs === right.ctimeMs;
|
|
@@ -1314,7 +2108,7 @@ var openExclusiveProcessLockFile = async (path) => {
|
|
|
1314
2108
|
return await open(
|
|
1315
2109
|
path,
|
|
1316
2110
|
constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY | constants.O_NOFOLLOW,
|
|
1317
|
-
|
|
2111
|
+
OWNER_ONLY_FILE_MODE
|
|
1318
2112
|
);
|
|
1319
2113
|
} catch (error) {
|
|
1320
2114
|
if (error.code === "EEXIST") return null;
|
|
@@ -1329,7 +2123,7 @@ var inspectProcessLockFile = async (path, label, probes) => {
|
|
|
1329
2123
|
if (error.code === "ENOENT") return { state: "missing" };
|
|
1330
2124
|
throw error;
|
|
1331
2125
|
}
|
|
1332
|
-
if (before.isSymbolicLink() || !before.isFile() || process.platform !== "win32" && (before.mode &
|
|
2126
|
+
if (before.isSymbolicLink() || !before.isFile() || process.platform !== "win32" && (before.mode & GROUP_OTHER_PERMISSION_BITS) !== 0 || typeof process.getuid === "function" && before.uid !== process.getuid()) {
|
|
1333
2127
|
throw new Error(`${label} is unsafe.`);
|
|
1334
2128
|
}
|
|
1335
2129
|
let handle;
|
|
@@ -1356,7 +2150,7 @@ var inspectProcessLockFile = async (path, label, probes) => {
|
|
|
1356
2150
|
} catch {
|
|
1357
2151
|
record = null;
|
|
1358
2152
|
}
|
|
1359
|
-
if (!record || record.schema_version !==
|
|
2153
|
+
if (!record || record.schema_version !== INFERENCE_HOST_PROCESS_LOCK_RECORD_SCHEMA_VERSION || !Number.isSafeInteger(record.pid) || Number(record.pid) < 1 || typeof record.owner_token !== "string" || !record.owner_token || typeof record.process_identity !== "string" || !record.process_identity || typeof record.boot_identity !== "string" || !record.boot_identity) {
|
|
1360
2154
|
if (Date.now() - stat.mtimeMs < PROCESS_LOCK_PUBLICATION_GRACE_MS) return { state: "busy" };
|
|
1361
2155
|
stale = true;
|
|
1362
2156
|
return { state: "stale", handle, stat };
|
|
@@ -1366,7 +2160,7 @@ var inspectProcessLockFile = async (path, label, probes) => {
|
|
|
1366
2160
|
const cacheKey = resolve(path);
|
|
1367
2161
|
if (await probes.currentBootIdentity() === record.boot_identity && probes.isProcessAlive(ownerPid)) {
|
|
1368
2162
|
const cached = processLockObservationCache.get(cacheKey);
|
|
1369
|
-
const observedIdentity = cached && cached.dev === stat.dev && cached.ino === stat.ino && cached.pid === ownerPid && cached.storedIdentity === storedIdentity && Date.now() - cached.observedAtMs <
|
|
2163
|
+
const observedIdentity = cached && cached.dev === stat.dev && cached.ino === stat.ino && cached.pid === ownerPid && cached.storedIdentity === storedIdentity && Date.now() - cached.observedAtMs < HOST_CORE_POLICY.process_lock_identity_cache_ms ? cached.observedIdentity : await probes.observeIdentity(ownerPid);
|
|
1370
2164
|
if (!observedIdentity) {
|
|
1371
2165
|
throw new Error("Inference host could not verify the existing lock owner identity.");
|
|
1372
2166
|
}
|
|
@@ -1423,7 +2217,7 @@ var removeStaleProcessLockReclaimGuard = async (lockPath, guardPath, inspection)
|
|
|
1423
2217
|
if (attempt > 0) {
|
|
1424
2218
|
await new Promise((resolvePromise) => setTimeout(
|
|
1425
2219
|
resolvePromise,
|
|
1426
|
-
Math.floor(Math.random() * PROCESS_LOCK_GUARD_ELECTION_BACKOFF_MS *
|
|
2220
|
+
Math.floor(Math.random() * PROCESS_LOCK_GUARD_ELECTION_BACKOFF_MS * BACKOFF_GROWTH_FACTOR ** Math.min(attempt, HOST_CORE_POLICY.process_lock_guard_election_backoff_exponent_max))
|
|
1427
2221
|
));
|
|
1428
2222
|
let current;
|
|
1429
2223
|
try {
|
|
@@ -1434,7 +2228,7 @@ var removeStaleProcessLockReclaimGuard = async (lockPath, guardPath, inspection)
|
|
|
1434
2228
|
}
|
|
1435
2229
|
if (!sameProcessLockFile(current, inspection.stat)) return;
|
|
1436
2230
|
}
|
|
1437
|
-
const ballotName = `${prefix}${randomBytes(
|
|
2231
|
+
const ballotName = `${prefix}${randomBytes(INFERENCE_HOST_RANDOM_BYTES.LOCK_BALLOT_NAME).toString("hex")}`;
|
|
1438
2232
|
const ballotPath = join(directory, ballotName);
|
|
1439
2233
|
const ballot = await openExclusiveProcessLockFile(ballotPath);
|
|
1440
2234
|
if (!ballot) continue;
|
|
@@ -1476,8 +2270,8 @@ var removeStaleProcessLockReclaimGuard = async (lockPath, guardPath, inspection)
|
|
|
1476
2270
|
};
|
|
1477
2271
|
var acquireProcessLockReclaimGuard = async (lockPath, ownerRecord, probes) => {
|
|
1478
2272
|
const guardPath = `${lockPath}.reclaim`;
|
|
1479
|
-
const guardToken = randomBytes(
|
|
1480
|
-
for (let attempt = 0; attempt <
|
|
2273
|
+
const guardToken = randomBytes(INFERENCE_HOST_RANDOM_BYTES.LOCK_TOKEN).toString("base64url");
|
|
2274
|
+
for (let attempt = 0; attempt < INFERENCE_HOST_RECLAIM_GUARD_CREATE_PASSES; attempt += 1) {
|
|
1481
2275
|
const handle = await openExclusiveProcessLockFile(guardPath);
|
|
1482
2276
|
if (handle) {
|
|
1483
2277
|
try {
|
|
@@ -1539,7 +2333,7 @@ var acquireProcessLockReclaimGuard = async (lockPath, ownerRecord, probes) => {
|
|
|
1539
2333
|
async function acquireInferenceHostProcessLock(path, dependencies = {}) {
|
|
1540
2334
|
const directory = dirname(path);
|
|
1541
2335
|
await ensureInferencePrivateDirectory(directory);
|
|
1542
|
-
const ownerToken = randomBytes(
|
|
2336
|
+
const ownerToken = randomBytes(INFERENCE_HOST_RANDOM_BYTES.LOCK_TOKEN).toString("base64url");
|
|
1543
2337
|
const probes = {
|
|
1544
2338
|
currentBootIdentity: dependencies.currentBootIdentity ?? (() => readInferenceSystemBootIdentity()),
|
|
1545
2339
|
observeIdentity: dependencies.processIdentity ?? defaultProcessIdentity,
|
|
@@ -1558,7 +2352,7 @@ async function acquireInferenceHostProcessLock(path, dependencies = {}) {
|
|
|
1558
2352
|
probes.currentBootIdentity()
|
|
1559
2353
|
]);
|
|
1560
2354
|
const ownerRecord = (token) => `${JSON.stringify({
|
|
1561
|
-
schema_version:
|
|
2355
|
+
schema_version: INFERENCE_HOST_PROCESS_LOCK_RECORD_SCHEMA_VERSION,
|
|
1562
2356
|
pid: process.pid,
|
|
1563
2357
|
owner_token: token,
|
|
1564
2358
|
process_identity: ownerIdentity,
|
|
@@ -1710,7 +2504,7 @@ var runInferenceHostServiceLauncher = async (manifestPathValue, lockPathValue, d
|
|
|
1710
2504
|
let manifest;
|
|
1711
2505
|
const log = async (event, version) => {
|
|
1712
2506
|
await appendFile(manifest.log_path, `${JSON.stringify({ at: (/* @__PURE__ */ new Date()).toISOString(), event, package_version: version })}
|
|
1713
|
-
`, { mode:
|
|
2507
|
+
`, { mode: OWNER_ONLY_FILE_MODE }).catch(() => void 0);
|
|
1714
2508
|
};
|
|
1715
2509
|
const runCore = dependencies.runCore ?? ((executable, target, args) => {
|
|
1716
2510
|
const processChild = spawn2(executable, [target.script, ...args], {
|
|
@@ -1817,7 +2611,7 @@ var runInferenceHostServiceLauncher = async (manifestPathValue, lockPathValue, d
|
|
|
1817
2611
|
r();
|
|
1818
2612
|
return;
|
|
1819
2613
|
}
|
|
1820
|
-
const timer2 = setTimeout(done,
|
|
2614
|
+
const timer2 = setTimeout(done, runtime_policy_generated_default.external_inference.service.launcher_poll_interval_ms);
|
|
1821
2615
|
function done() {
|
|
1822
2616
|
clearTimeout(timer2);
|
|
1823
2617
|
readiness.signal.removeEventListener("abort", done);
|
|
@@ -1871,12 +2665,12 @@ var runInferenceHostServiceLauncher = async (manifestPathValue, lockPathValue, d
|
|
|
1871
2665
|
break;
|
|
1872
2666
|
} catch (error) {
|
|
1873
2667
|
if (!/already owns/iu.test(error instanceof Error ? error.message : "")) throw error;
|
|
1874
|
-
await new Promise((r) => setTimeout(r,
|
|
2668
|
+
await new Promise((r) => setTimeout(r, runtime_policy_generated_default.external_inference.service.launcher_poll_interval_ms));
|
|
1875
2669
|
}
|
|
1876
2670
|
}
|
|
1877
2671
|
}
|
|
1878
2672
|
if (!await desired()) return 0;
|
|
1879
|
-
if (code ===
|
|
2673
|
+
if (code === EXIT_CODE_TEMPFAIL) {
|
|
1880
2674
|
const selected = await readLauncherSelection(manifestPath);
|
|
1881
2675
|
if (selected && selected.package_version !== state.active.package_version) {
|
|
1882
2676
|
let next;
|