-
Notifications
You must be signed in to change notification settings - Fork 309
Expand file tree
/
Copy pathstatus.py
More file actions
3018 lines (2782 loc) · 118 KB
/
Copy pathstatus.py
File metadata and controls
3018 lines (2782 loc) · 118 KB
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
31
32
33
34
35
36
37
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
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
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from __future__ import annotations
from pathlib import Path
import re
from typing import Any
from .benchmarks.read_models.skillsbench_verifier_attribution import (
apply_skillsbench_verifier_bootstrap_missing_score_attribution,
)
from .control_plane import compact_control_plane_policy
from .control_plane.status.collection import (
StatusCollectionContext,
collect_status as _collect_status_read_model,
)
from .control_plane.status.runtime_summaries import (
StatusRuntimeSummaryContext,
build_status_runtime_summaries as _build_status_runtime_summaries_read_model,
)
from .contract import check_contract
from .control_plane.work_items.delivery_batch_scale import (
SMALL_DELIVERY_BATCH_SCALES as STRUCTURED_SMALL_DELIVERY_BATCH_SCALES,
UNKNOWN_DELIVERY_BATCH_SCALE,
)
from .control_plane.work_items.delivery_outcome import (
DELIVERY_OUTCOME_NOT_CONFIGURED,
PROGRESS_DELIVERY_OUTCOMES,
delivery_turn_kind_for_run,
)
from .doctor import (
PROMOTION_READINESS_CLASSIFICATIONS,
PROMOTION_READINESS_FRESHNESS_HOURS,
add_promotion_readiness_freshness,
latest_promotion_readiness_event,
)
from .execution_profile import (
compact_execution_profile,
execution_profile_outcome_floor,
)
from .control_plane.goals.goal_channel_projection import build_goal_channel_projection
from .handoff_budget import handoff_budget_contract
from .history import collect_history, load_registry
from .history import STATUS_NEUTRAL_CLASSIFICATIONS as HISTORY_STATUS_NEUTRAL_CLASSIFICATIONS
from .interface_budget import interface_budget_cadence_for_runs
from .long_task_cadence import build_long_task_cadence_hint
from .operator_gate import DEFAULT_OPERATOR_GATE, default_operator_question, normalize_operator_question
from .orchestration import compact_orchestration_policy
from .paths import global_registry_path, resolve_runtime_root
from .control_plane.work_items.task_graph import (
build_task_graph_projection as _build_task_graph_projection_read_model,
)
from .control_plane.work_items.project_asset import (
TODO_PROJECTION_DETAIL_POINTER_SCHEMA_VERSION as TODO_PROJECTION_DETAIL_POINTER_SCHEMA_VERSION,
TODO_PROJECTION_VIEW_SCHEMA_VERSION as TODO_PROJECTION_VIEW_SCHEMA_VERSION,
attach_active_state_project_asset_fields as _attach_active_state_project_asset_fields,
build_project_asset,
enrich_project_asset as _enrich_project_asset_read_model,
project_asset_handoff_check_projection,
project_asset_latest_validation,
project_asset_quota_state,
project_asset_quota_summary,
project_asset_summary_is_public_safe as project_asset_summary_is_public_safe,
project_asset_todo_projection_gap,
project_asset_user_todo_open_count,
)
from .control_plane.todos.completed_archive import completed_todo_archive_warning
from .control_plane.handoff.project_handoff import (
project_asset_handoff_readiness as _project_asset_handoff_readiness_read_model,
project_asset_handoff_state as _project_asset_handoff_state_read_model,
)
from .control_plane.work_items.autonomous_candidates import (
MAX_AUTONOMOUS_TODO_CANDIDATES as _MAX_AUTONOMOUS_TODO_CANDIDATES,
)
from .control_plane.agents.agent_lane_recommendation import (
compact_agent_lane_recommendation as _compact_agent_lane_recommendation_read_model,
is_status_neutral_run as _is_status_neutral_run_read_model,
latest_agent_lane_run as _latest_agent_lane_run_read_model,
latest_run_recommended_action_for_projection as _latest_run_recommended_action_for_projection_read_model,
)
from .control_plane.goals.active_state_sections import (
active_state_section_entries as _active_state_section_entries_read_model,
active_state_sections as _active_state_sections_read_model,
)
from .control_plane.goals.active_state_metadata import (
parse_state_frontmatter,
)
from .control_plane.goals.active_state_event_projection import (
active_state_event_projection_fields as _active_state_event_projection_fields_read_model,
state_event_log_candidates as _state_event_log_candidates_read_model,
)
from .control_plane.todos.active_state_todos import (
MONITOR_WRITEBACK_CONTRACT_SCHEMA_VERSION as _MONITOR_WRITEBACK_CONTRACT_SCHEMA_VERSION,
active_state_todo_fields as _active_state_todo_fields_read_model,
)
from .control_plane.todos.active_state_todo_parser import (
parse_active_state_todos,
)
from .control_plane.work_items.attention_item import (
attention_item as _attention_item_read_model,
)
from .control_plane.work_items.attention_queue import (
AttentionQueueContext,
build_attention_queue as _build_attention_queue_read_model,
merge_global_registry_findings as _merge_global_registry_findings_read_model,
)
from .control_plane.work_items.attention_routing import (
goal_attention as _goal_attention_read_model,
)
from .control_plane.work_items.attention_fields import (
operator_gate_attention_fields as _operator_gate_attention_fields_read_model,
readiness_attention_fields as _readiness_attention_fields_read_model,
)
from .control_plane.work_items.autonomous_replan_ack import (
AUTONOMOUS_REPLAN_ACK_MATERIAL_RUN_WINDOW,
compact_autonomous_replan_ack,
)
from .control_plane.work_items.autonomous_replan_obligation import (
AUTONOMOUS_REPLAN_STALL_THRESHOLD as _AUTONOMOUS_REPLAN_STALL_THRESHOLD_READ_MODEL,
AUTONOMOUS_REPLAN_TRIGGER_PATTERNS as _AUTONOMOUS_REPLAN_TRIGGER_PATTERNS_READ_MODEL,
MAX_AUTONOMOUS_REPLAN_TRIGGERS as _MAX_AUTONOMOUS_REPLAN_TRIGGERS_READ_MODEL,
autonomous_replan_obligation_from_state as _autonomous_replan_obligation_from_state_read_model,
)
from .control_plane.work_items.backlog_hygiene import (
MAX_BACKLOG_HYGIENE_EVIDENCE_ITEMS as _MAX_BACKLOG_HYGIENE_EVIDENCE_ITEMS_READ_MODEL,
backlog_hygiene_warning as _backlog_hygiene_warning_read_model,
)
from .control_plane.goals.dreaming import (
compact_dreaming_lane_badge as _compact_dreaming_lane_badge_read_model,
compact_dreaming_proposal as _compact_dreaming_proposal_read_model,
compact_server_planning_contract as _compact_server_planning_contract_read_model,
dreaming_attention_fields as _dreaming_attention_fields_read_model,
)
from .control_plane.work_items.delivery_signals import (
classification_contains_any as _classification_contains_any_read_model,
delivery_batch_scale_for_run as _delivery_batch_scale_for_run_read_model,
delivery_outcome_for_run as _delivery_outcome_for_run_read_model,
outcome_floor_configured as _outcome_floor_configured_read_model,
outcome_gap_streak as _outcome_gap_streak_read_model,
small_delivery_batch_scale_streak as _small_delivery_batch_scale_streak_read_model,
)
from .control_plane.scheduler.monitor_display import (
attention_item_is_monitor_quiet_display_candidate as _attention_item_is_monitor_quiet_display_candidate,
normalize_monitor_quiet_attention_display as _normalize_monitor_quiet_attention_display,
quiet_monitor_display_action as _quiet_monitor_display_action,
todo_summary_lane_items as _todo_summary_lane_items,
todo_summary_open_count as _todo_summary_open_count,
)
from .control_plane.runtime.run_compaction import (
RUN_BASE_COMPACT_FIELDS,
attach_run_summary_projections as _attach_run_summary_projections_read_model,
compact_controller_readiness,
compact_human_reward,
compact_operator_gate,
compact_operator_gate_resume_contract,
compact_run_base as _compact_run_base_read_model,
)
from .control_plane.runtime.status_classifications import (
BLOCKING_CLASSIFICATIONS,
CODEX_READY_CLASSIFICATIONS,
DREAMING_ADVISORY_CLASSIFICATIONS,
HANDOFF_READY_CLASSIFICATIONS,
USER_OR_CONTROLLER_CLASSIFICATIONS,
)
from .benchmarks.read_models.benchmark_projection import (
benchmark_run_source as _benchmark_run_source_read_model,
build_benchmark_solution_quality_signals,
compact_benchmark_run_core as _compact_benchmark_run_core_read_model,
compact_benchmark_run_trials as _compact_benchmark_run_trials_read_model,
compact_benchmark_run_validation as _compact_benchmark_run_validation_read_model,
)
from .benchmarks.read_models.benchmark_comparison import (
benchmark_comparison_decision_note as _benchmark_comparison_decision_note_read_model,
compact_benchmark_comparison as _compact_benchmark_comparison_read_model,
)
from .benchmarks.read_models.benchmark_attempt_accounting import (
compact_benchmark_attempt_accounting as _compact_benchmark_attempt_accounting,
)
from .benchmarks.read_models.benchmark_experiment_report import (
benchmark_experiment_report_readiness_note,
benchmark_experiment_report_replay_decision,
compact_benchmark_experiment_report,
)
from .benchmarks.read_models.benchmark_learning_ledger import (
compact_benchmark_learning_ledger,
)
from .benchmarks.read_models.benchmark_result import compact_benchmark_result
from .benchmarks.read_models.benchmark_run_execution_contract import (
compact_benchmark_run_execution_contract as _compact_benchmark_run_execution_contract,
)
from .benchmarks.read_models.benchmark_run_post_execution import (
compact_benchmark_run_post_execution_metadata as _compact_benchmark_run_post_execution_metadata,
repair_product_mode_lifecycle_missing_attribution as _repair_product_mode_lifecycle_missing_attribution_read_model,
)
from .benchmarks.read_models.benchmark_run_pre_execution import (
compact_benchmark_run_pre_execution_metadata as _compact_benchmark_run_pre_execution_metadata,
)
from .control_plane.runtime.public_safety import (
compact_loopx_command_records as _compact_loopx_command_records,
compact_numeric_map as _compact_numeric_map,
public_safe_compact_list,
public_safe_compact_text,
)
from .control_plane.runtime.active_user_assisted_pilot import (
compact_active_user_assisted_pilot as _compact_active_user_assisted_pilot_read_model,
)
from .control_plane.runtime.run_ingest_health import (
worker_bridge_ingest_health_note,
)
from .control_plane.runtime.time import parse_timestamp
from .control_plane.runtime.run_history import (
latest_run as _latest_run_read_model,
)
from .control_plane.runtime.decision_freshness import (
DECISION_FRESHNESS_CLASSIFICATION_PREFIXES,
DECISION_FRESHNESS_ITEM_LIMIT,
DECISION_FRESHNESS_PROXY_NOTE,
DECISION_FRESHNESS_WINDOW_DAYS,
)
from .control_plane.runtime.promotion_readiness import (
PROMOTION_READINESS_PROXY_NOTE,
)
from .control_plane.handoff.handoff_runs import (
is_custom_post_handoff_work_run as _is_custom_post_handoff_work_run_read_model,
is_handoff_ready_run as _is_handoff_ready_run_read_model,
run_has_external_evidence_watch_signal as _run_has_external_evidence_watch_signal_read_model,
)
from .control_plane.goals.global_registry_shadow import (
attach_global_registry_shadow_finding,
)
from .control_plane.goals.global_registry_health import (
collect_global_registry_health as _collect_global_registry_health_read_model,
)
from .control_plane.goals.path_resolution import resolve_goal_local_path, same_path
from .control_plane.goals.goal_channel import (
attach_goal_channel_projection as _attach_goal_channel_projection_read_model,
)
from .control_plane.goals.goal_vision import (
compact_goal_vision_packet as _compact_goal_vision_packet_read_model,
)
from .control_plane.work_items.issue_meta_surface import (
parse_issue_meta_surface as _parse_issue_meta_surface_read_model,
)
from .control_plane.work_items.lifecycle import (
goal_lifecycle_fields as _goal_lifecycle_fields_read_model,
ordered_lifecycle_flags as _ordered_lifecycle_flags_read_model,
primary_lifecycle_phase as _primary_lifecycle_phase_read_model,
run_lifecycle_flags as _run_lifecycle_flags_read_model,
run_lifecycle_phase as _run_lifecycle_phase_read_model,
)
from .control_plane.runtime.session_runtime import (
compact_session_runtime_projection_from_run,
legacy_runtime_goal_attention as _legacy_runtime_goal_attention_read_model,
)
from .benchmarks.read_models.skillsbench_post_run_debug import (
build_skillsbench_post_run_debug_gate,
)
from .control_plane.agents.subagent_activity import (
MAX_SUBAGENT_ACTIVITY_ITEMS,
compact_subagent_run,
subagent_activity_for_goal,
)
from .control_plane.agents.management_projection import (
build_agent_management_projection as _build_agent_management_projection_read_model,
)
from .control_plane.runtime.stale_latest_run import (
stale_latest_run_projection_warning as _stale_latest_run_projection_warning_read_model,
)
from .control_plane.todos.todo_summary import (
MAX_DEFERRED_TODO_VISIBILITY_ITEMS as _TODO_SUMMARY_MAX_DEFERRED_TODO_VISIBILITY_ITEMS,
MAX_DEPENDENCY_BLOCKERS as _TODO_SUMMARY_MAX_DEPENDENCY_BLOCKERS,
MAX_MONITOR_DUE_ITEMS as _TODO_SUMMARY_MAX_MONITOR_DUE_ITEMS,
MAX_PROJECT_ASSET_TODO_BACKLOG_ITEMS as _TODO_SUMMARY_MAX_PROJECT_ASSET_TODO_BACKLOG_ITEMS,
MAX_PROJECT_ASSET_TODO_ITEMS as _TODO_SUMMARY_MAX_PROJECT_ASSET_TODO_ITEMS,
MAX_STATUS_TODOS_PER_ROLE as _TODO_SUMMARY_MAX_STATUS_TODOS_PER_ROLE,
MAX_TODO_VISIBILITY_LANE_ITEMS as _TODO_SUMMARY_MAX_TODO_VISIBILITY_LANE_ITEMS,
active_state_todo_attention_item as _active_state_todo_attention_item_read_model,
active_next_action_todo_ids,
attach_dependency_blockers,
claimed_visibility_items as claimed_visibility_items,
compact_todo_group as compact_todo_group,
compact_todo_item as compact_todo_item,
first_open_todo_text,
normalize_todo_text,
open_todo_items,
project_asset_todo_summary,
sync_connected_attention_action_from_todos as _sync_connected_attention_action_from_todos_read_model,
todo_lane_items as todo_lane_items,
todo_item_is_actionable_open,
todo_item_is_deferred as todo_item_is_deferred,
todo_item_is_due_monitor as todo_item_is_due_monitor,
todo_item_missing_monitor_schedule as todo_item_missing_monitor_schedule,
todo_item_next_due_at as todo_item_next_due_at,
todo_item_task_class,
todo_projection_sort_key as todo_projection_sort_key,
)
from .control_plane.todos.todo_index import (
MAX_TODO_INDEX_ITEMS,
MAX_TODO_INDEX_ROLLOUT_EVENTS_PER_GOAL,
)
from .promotion_gate import build_promotion_gate
from .quota import quota_status, quota_with_handoff_outcome_floor
from .registry import registry_goals
from .rollout_event_log import load_rollout_events, rollout_event_log_path
from .state_projection import (
active_state_next_action_entries,
actions_are_projection_aligned,
next_action_projection_warning,
state_projection_gap_warning,
)
from .control_plane.todos.contract import (
TODO_STATUS_OPEN,
TODO_TASK_CLASS_USER_GATE,
normalize_todo_status,
normalize_todo_task_class as normalize_todo_task_class,
todo_done_for_status,
)
from .control_plane.todos.projection import (
todo_item_is_expired_monitor as todo_item_is_expired_monitor,
)
_PUBLIC_COMPAT_REEXPORTS = {
"TODO_PROJECTION_DETAIL_POINTER_SCHEMA_VERSION": "loopx.control_plane.work_items.project_asset",
"TODO_PROJECTION_VIEW_SCHEMA_VERSION": "loopx.control_plane.work_items.project_asset",
"project_asset_summary_is_public_safe": "loopx.control_plane.work_items.project_asset",
"claimed_visibility_items": "loopx.control_plane.todos.todo_summary",
"compact_todo_group": "loopx.control_plane.todos.todo_summary",
"compact_todo_item": "loopx.control_plane.todos.todo_summary",
"todo_lane_items": "loopx.control_plane.todos.todo_summary",
"todo_item_is_deferred": "loopx.control_plane.todos.todo_summary",
"todo_item_is_due_monitor": "loopx.control_plane.todos.todo_summary",
"todo_item_missing_monitor_schedule": "loopx.control_plane.todos.todo_summary",
"todo_item_next_due_at": "loopx.control_plane.todos.todo_summary",
"todo_projection_sort_key": "loopx.control_plane.todos.todo_summary",
"normalize_todo_task_class": "loopx.control_plane.todos.contract",
"todo_item_is_expired_monitor": "loopx.control_plane.todos.projection",
}
STATUS_NEUTRAL_CLASSIFICATIONS = HISTORY_STATUS_NEUTRAL_CLASSIFICATIONS
STATE_EVENT_LOG_BASENAME = "events.jsonl"
STATUS_CONTROL_PLANE_CONTEXT_LIMIT = 20
AGENT_LANE_PROGRESS_SCOPE = "agent_lane"
REGISTRY_WAITING_ON_OVERRIDES = {
"user_or_controller",
"controller",
"codex",
"external_evidence",
}
LEGACY_EXTERNAL_EVIDENCE_CLASSIFICATION_PREFIXES = (
"await_",
"external_evidence_observation_",
)
MONITOR_SIGNAL_WAITING_ON = "monitor_signal"
MONITOR_DISPLAY_SCHEMA_VERSION = "monitor_quiet_display_v0"
MONITOR_DISPLAY_STOP_CONDITION = (
"stop until a material monitor transition, regression, or concrete blocker appears"
)
MONITOR_DISPLAY_FALLBACK_ACTION = (
"No immediate agent work; keep the monitor quiet until a material monitor "
"transition, regression, or concrete blocker appears."
)
BENCHMARK_RUN_SCHEMA_VERSION = "benchmark_run_v0"
MAX_BENCHMARK_RUN_TRIALS = 3
MAX_BENCHMARK_RUN_LIST_ITEMS = 5
STATUS_CONTRACT_SCHEMA_VERSION = 2
MINIMUM_DASHBOARD_STATUS_CONTRACT_SCHEMA_VERSION = 2
STATUS_CONTRACT_RELOAD_HINT = "scripts/macos-dashboard-launchagent.sh restart"
STATUS_CONTRACT_SIGNAL_LIMIT = 3
MONITOR_WRITEBACK_CONTRACT_SCHEMA_VERSION = _MONITOR_WRITEBACK_CONTRACT_SCHEMA_VERSION
EVENT_LEDGER_DECISION_CLASSIFICATIONS = USER_OR_CONTROLLER_CLASSIFICATIONS | {
"operator_gate_approved",
}
EVENT_LEDGER_STATE_CLASSIFICATIONS = {
"state_refreshed",
"public_harness_healthy",
}
EVENT_LEDGER_EVIDENCE_CLASSIFICATIONS = {
"inspect_eval_result",
"inspect_result",
"needs_more_read_only_evidence",
"read_only_project_map",
}
EVENT_LEDGER_EVIDENCE_HINTS = (
"artifact",
"blocker",
"ci",
"data",
"deploy",
"done",
"eval",
"evidence",
"failure",
"fail",
"metric",
"monitor",
"validation",
)
DELIVERY_BATCH_SCALE_TEST_ONLY_CLASSIFICATION_HINTS = (
"_test",
"_smoke",
"readiness_test",
"integrity_test",
)
DELIVERY_BATCH_SCALE_MULTI_SURFACE_CLASSIFICATION_HINTS = (
"batch",
"cross_benchmark",
"downstream_pack",
"matrix",
"owner_handoff_consumer",
)
DELIVERY_BATCH_SCALE_IMPLEMENTATION_CLASSIFICATION_HINTS = (
"adapter",
"builder",
"consumer",
"implementation",
"runner",
)
SMALL_DELIVERY_BATCH_SCALES = {
*(scale.value for scale in STRUCTURED_SMALL_DELIVERY_BATCH_SCALES),
UNKNOWN_DELIVERY_BATCH_SCALE,
}
CONNECTED_ADAPTER_STATUSES = {
"connected",
"connected-read-only",
"pre-tick-runnable",
}
CONNECTED_DELIVERY_ADAPTER_STATUSES = {
"connected-delivery",
}
SOURCE_REGISTRY_SHADOW_FINDINGS = {
"source_registry_missing",
"stale_source_registry",
}
PLANNED_CONTROLLER_OPT_IN_RECOMMENDED_ACTION = (
"先在 LoopX 完成 operator 判断;同意后项目 Agent 只执行 read-only map dry-run"
)
RUN_COMPACT_FIELDS = RUN_BASE_COMPACT_FIELDS
LIFECYCLE_PRIORITY = (
"controller_ready",
"reward_judged",
"operator_approved",
"controller_gated",
"operator_gated",
"adapter_inspected",
"mapped",
"refreshed",
"connected",
"registered",
"planned",
"run_recorded",
)
SECTION_HEADING_PATTERN = re.compile(r"^##+\s+(.+?)\s*$")
MAX_STATUS_TODOS_PER_ROLE = _TODO_SUMMARY_MAX_STATUS_TODOS_PER_ROLE
MAX_ACTIVE_DONE_TODOS_BEFORE_ARCHIVE = MAX_STATUS_TODOS_PER_ROLE
MAX_PROJECT_ASSET_TODO_ITEMS = _TODO_SUMMARY_MAX_PROJECT_ASSET_TODO_ITEMS
MAX_PROJECT_ASSET_TODO_BACKLOG_ITEMS = _TODO_SUMMARY_MAX_PROJECT_ASSET_TODO_BACKLOG_ITEMS
MAX_TODO_VISIBILITY_LANE_ITEMS = _TODO_SUMMARY_MAX_TODO_VISIBILITY_LANE_ITEMS
MAX_DEFERRED_TODO_VISIBILITY_ITEMS = _TODO_SUMMARY_MAX_DEFERRED_TODO_VISIBILITY_ITEMS
MAX_MONITOR_DUE_ITEMS = _TODO_SUMMARY_MAX_MONITOR_DUE_ITEMS
MAX_DEPENDENCY_BLOCKERS = _TODO_SUMMARY_MAX_DEPENDENCY_BLOCKERS
MAX_AUTONOMOUS_BACKLOG_CANDIDATES = _MAX_AUTONOMOUS_TODO_CANDIDATES
MAX_BACKLOG_HYGIENE_EVIDENCE_ITEMS = _MAX_BACKLOG_HYGIENE_EVIDENCE_ITEMS_READ_MODEL
MAX_AUTONOMOUS_REPLAN_TRIGGERS = _MAX_AUTONOMOUS_REPLAN_TRIGGERS_READ_MODEL
AUTONOMOUS_REPLAN_STALL_THRESHOLD = _AUTONOMOUS_REPLAN_STALL_THRESHOLD_READ_MODEL
DEAD_MONITOR_REPEAT_THRESHOLD = 6
AUTONOMOUS_REPLAN_PERIODIC_RUN_THRESHOLD = AUTONOMOUS_REPLAN_ACK_MATERIAL_RUN_WINDOW
AUTONOMOUS_REPLAN_PERIODIC_LOOKBACK = 30
BACKLOG_HYGIENE_SECTION_HEADINGS = ("Next Action", "Operating Lessons")
BACKLOG_HYGIENE_BULLET_PATTERN = re.compile(r"^\s*(?:[-*]|\d+[.)])\s+(.+?)\s*$")
BACKLOG_HYGIENE_HINT_PATTERN = re.compile(
r"(?i)(?:\[p[0-4]\]|todo|backlog|follow[- ]?up|queue|audit|regression|smoke|cadence|mirror|monitor|sub-?agent|待办|回归|审计|修复|检查|推进)"
)
AUTONOMOUS_REPLAN_SCHEMA_VERSION = "autonomous_replan_obligation_v0"
DEAD_MONITOR_REPEAT_SCHEMA_VERSION = "dead_monitor_repeat_v0"
AUTONOMOUS_REPLAN_SECTION_HEADINGS = (
"Next Action",
"Operating Lessons",
)
AUTONOMOUS_REPLAN_TRIGGER_PATTERNS = _AUTONOMOUS_REPLAN_TRIGGER_PATTERNS_READ_MODEL
AUTONOMOUS_RUN_HISTORY_PROGRESS_OUTCOMES = PROGRESS_DELIVERY_OUTCOMES
AUTONOMOUS_RUN_HISTORY_NEUTRAL_CLASSIFICATIONS = {
"quota_slot_spent",
"quota_slot_voided",
"delivery_completion_spend_accounted_v0",
}
AUTONOMOUS_RUN_HISTORY_STALL_PATTERN = re.compile(
r"(?i)(?:monitor|observe|observation|poll|watch|quiet|no[-_ ]?op|no[-_ ]?progress|stalled?|unchanged|dependency|停转|无进展|重复|反复|观察|轮询)"
)
def _compact_benchmark_interaction_counters(value: Any) -> dict[str, Any]:
if not isinstance(value, dict):
return {}
compact: dict[str, Any] = {}
schema = public_safe_compact_text(value.get("schema_version"), limit=100)
if schema:
compact["schema_version"] = schema
for field in (
"prompt_policy_injected",
"harness_skill_or_packet_injected",
"raw_trace_recorded",
"raw_task_prompt_recorded",
"controller_trace_present",
"loopx_automation_loop",
"inner_codex_goal_mode",
"curated_skills_visible",
"product_mode",
"goal_start_product_mode",
"verifier_failure_feedback_todo_route",
"verifier_failure_feedback_forwarded_to_agent",
"verifier_failure_todo_required",
"goal_start_plan_observed",
"planner_before_todo_write",
"same_priority_order_preserved",
"selected_todo_claimed",
"selected_todo_updated_before_solver",
"selected_todo_completed_before_spend",
"selected_todo_completed_observed",
"non_selected_todos_preserved_open_or_deferred",
"quota_spend_missing_after_repeated_complete",
"blind_loop",
"case_goal_state_packet_present",
"case_goal_state_init_required",
"case_goal_state_initialized_before_agent",
"declared_done_requires_no_remaining_goals",
"product_mode_lifecycle_checkpoint_required",
"product_mode_solver_activity_required",
"product_mode_solver_activity_gap",
"product_mode_declared_done_below_passing_reward",
"product_mode_no_open_todo_below_passing_reward_stop",
"product_mode_typed_repair_required",
"product_mode_typed_repair_pending",
"product_mode_typed_repair_todo_identity_observed",
"product_mode_typed_repair_task_or_validation_delta",
"product_mode_typed_repair_delta_observed",
"product_mode_typed_repair_terminal",
"product_mode_typed_repair_terminal_receipt_consistent",
"product_mode_host_local_idle_no_task_output_progress",
"product_mode_host_local_idle_no_task_output_progress_stop",
"product_mode_final_closeout_superseded_by_official_success",
"product_mode_no_tool_call_lifecycle_abort",
"agent_declared_done",
"agent_declared_no_remaining_goals",
"official_feedback_blinded",
"reward_feedback_forwarded",
"controller_official_feedback_forwarded",
"controller_blind_loop",
"controller_official_success_observed",
"controller_budget_cutoff_before_followup",
"benchflow_user_loop_final_verify_recovery_enabled",
"benchflow_user_loop_final_verify_recovery_triggered",
"benchflow_user_loop_recovery_after_agent_activity",
"benchflow_user_loop_recovery_preserved_final_verify",
"benchflow_user_loop_recovery_raw_error_recorded",
"benchflow_intermediate_soft_verify_final_only",
"benchflow_intermediate_soft_verify_raw_output_recorded",
"benchflow_intermediate_soft_verify_timeout_enabled",
"benchflow_intermediate_soft_verify_timeout_triggered",
"benchflow_intermediate_soft_verify_timeout_raw_output_recorded",
"benchflow_intermediate_soft_verify_timeout_cleanup_requested",
"benchflow_intermediate_soft_verify_timeout_cleanup_raw_logs_read",
"benchflow_intermediate_soft_verify_orphan_cleanup_requested",
"benchflow_intermediate_soft_verify_orphan_cleanup_raw_logs_read",
"private_trajectory_summary_present",
"native_goal_worker_route",
"native_goal_worker_connected",
"native_goal_worker_trace_dir_present",
"native_goal_worker_public_trace_read",
"native_goal_worker_raw_material_recorded",
"remote_command_file_bridge_consumed_by_solver",
"remote_command_file_bridge_solver_trace_dir_present",
"remote_command_file_bridge_solver_public_trace_read",
"remote_command_file_bridge_solver_raw_material_recorded",
"remote_command_file_bridge_agent_operation_trace_required",
"remote_command_file_bridge_agent_operation_trace_satisfied",
"remote_command_file_bridge_driver_lifecycle_trace_present",
"remote_command_file_bridge_driver_lifecycle_raw_material_recorded",
"host_local_acp_codex_exec_failure_trace_present",
"host_local_acp_codex_exec_failure_raw_material_recorded",
):
if isinstance(value.get(field), bool):
compact[field] = value[field]
for field in (
"loopx_state_reads",
"loopx_state_writes",
"loopx_case_state_reads",
"loopx_case_state_writes",
"heartbeat_count",
"controller_action_decisions",
"controller_initial_prompt_count",
"controller_followup_prompt_count",
"controller_stop_decision_count",
"controller_reward_observation_count",
"controller_round_reward_count",
"controller_official_success_observation_count",
"controller_first_success_round",
"declared_done_round",
"planned_todo_count",
"planned_p0_count",
"agent_todo_complete_unique_todo_count",
"selected_todo_complete_count",
"selected_todo_duplicate_complete_count",
"non_selected_todo_complete_count",
"todo_complete_without_todo_id_count",
"product_mode_lifecycle_checkpoint_count",
"product_mode_lifecycle_checkpoint_round",
"product_mode_solver_activity_gap_count",
"product_mode_solver_activity_gap_round",
"product_mode_declared_done_below_passing_reward_count",
"product_mode_declared_done_below_passing_reward_round",
"verifier_failure_feedback_todo_prompt_count",
"verifier_failure_feedback_todo_round",
"open_todo_count",
"product_mode_no_open_todo_below_passing_reward_streak",
"product_mode_no_open_todo_below_passing_reward_streak_threshold",
"product_mode_no_open_todo_below_passing_reward_round",
"product_mode_no_open_todo_below_passing_reward_stop_count",
"product_mode_no_open_todo_below_passing_reward_stop_round",
"product_mode_no_open_todo_below_passing_reward_open_todo_count_public",
"product_mode_typed_repair_trigger_round",
"product_mode_typed_repair_round_entered",
"product_mode_typed_repair_round_entered_count",
"product_mode_typed_repair_resolved_round",
"product_mode_typed_repair_task_facing_success_delta",
"product_mode_typed_repair_terminal_round",
"product_mode_typed_repair_open_todo_count_public",
"product_mode_host_local_idle_no_task_output_progress_streak",
"product_mode_host_local_idle_no_task_output_progress_streak_threshold",
"product_mode_host_local_idle_no_task_output_progress_round",
"product_mode_host_local_idle_no_task_output_progress_stop_count",
"product_mode_host_local_idle_no_task_output_progress_stop_round",
"product_mode_host_local_idle_no_task_output_progress_last_failure_trace_count",
"product_mode_host_local_idle_no_task_output_progress_acp_tool_calls",
"product_mode_host_local_idle_no_task_output_progress_bridge_task_ops",
"product_mode_host_local_idle_no_task_output_progress_bridge_task_successes",
"product_mode_final_closeout_superseded_round",
"product_mode_no_tool_call_lifecycle_abort_count",
"product_mode_no_tool_call_lifecycle_abort_round",
"controller_verifier_feedback_observation_count",
"controller_official_feedback_blinded_count",
"controller_official_feedback_forwarded_count",
"controller_max_rounds_budget",
"benchflow_user_loop_recovery_round",
"benchflow_user_loop_recovery_delta_events",
"benchflow_user_loop_recovery_delta_tool_calls",
"benchflow_intermediate_soft_verify_call_count",
"benchflow_intermediate_soft_verify_skipped_count",
"benchflow_intermediate_soft_verify_timeout_sec",
"benchflow_intermediate_soft_verify_timeout_override_count",
"benchflow_intermediate_soft_verify_timeout_cleanup_container_count",
"benchflow_intermediate_soft_verify_timeout_cleanup_match_count",
"benchflow_intermediate_soft_verify_timeout_cleanup_term_sent_count",
"benchflow_intermediate_soft_verify_timeout_cleanup_kill_sent_count",
"benchflow_intermediate_soft_verify_timeout_cleanup_alive_after_count",
"benchflow_intermediate_soft_verify_orphan_cleanup_container_count",
"benchflow_intermediate_soft_verify_orphan_cleanup_match_count",
"benchflow_intermediate_soft_verify_orphan_cleanup_term_sent_count",
"benchflow_intermediate_soft_verify_orphan_cleanup_kill_sent_count",
"benchflow_intermediate_soft_verify_orphan_cleanup_alive_after_count",
"private_trajectory_event_count",
"private_trajectory_round_count",
"private_trajectory_tool_call_count",
"loopx_cli_call_count",
"loopx_cli_state_read_count",
"loopx_cli_state_write_count",
"loopx_case_state_path_count",
"loopx_case_state_read_count",
"loopx_case_state_write_count",
"protected_path_mention_count",
"protected_path_edit_signal_count",
"codex_acp_text_bytes",
"append_benchmark_run_success_count",
"append_benchmark_run_schema_rejected_count",
"worker_counter_trace_trial_count",
"worker_benchmark_run_file_count",
"worker_benchmark_run_schema_ok_count",
"worker_self_validation_official_score_mismatch_count",
"worker_validation_scope_ambiguous_official_score_failure_count",
"worker_bridge_connected_official_score_failure_count",
"worker_startup_blocker_count",
"worker_setup_diagnostic_file_count",
"worker_setup_diagnostic_schema_ok_count",
"worker_submit_eligible_mismatch_count",
"worker_bridge_writeback_loss_count",
"environment_setup_failure_before_worker_count",
"pre_worker_agent_setup_failure_count",
"codex_runtime_goal_tool_trial_count",
"native_goal_worker_connect_count",
"native_goal_worker_trace_count",
"native_goal_worker_lifecycle_trace_count",
"native_goal_worker_prompt_received_count",
"native_goal_worker_ok_count",
"native_goal_worker_goal_get_count",
"native_goal_worker_turn_start_count",
"native_goal_worker_turn_completed_observed_count",
"native_goal_worker_assistant_message_present_count",
"native_goal_worker_assistant_context_only_count",
"native_goal_worker_context_only_recovery_attempted_count",
"native_goal_worker_context_only_recovery_succeeded_count",
"native_goal_worker_context_only_followup_start_attempted_count",
"native_goal_worker_context_only_followup_start_succeeded_count",
"native_goal_worker_normal_followup_attempted_count",
"native_goal_worker_normal_followup_succeeded_count",
"native_goal_worker_normal_followup_start_attempted_count",
"native_goal_worker_normal_followup_start_succeeded_count",
"native_goal_worker_finish_guard_followup_attempted_count",
"native_goal_worker_finish_guard_followup_succeeded_count",
"native_goal_worker_finish_guard_followup_start_attempted_count",
"native_goal_worker_finish_guard_followup_start_succeeded_count",
"native_goal_worker_incomplete_turn_status_count",
"native_goal_worker_incomplete_after_completion_event_count",
"native_goal_worker_transport_reconnect_attempted_count",
"native_goal_worker_transport_reconnect_succeeded_count",
"native_goal_worker_goal_reactivation_attempted_count",
"native_goal_worker_goal_reactivation_succeeded_count",
"native_goal_worker_post_context_assistant_chars_total",
"native_goal_worker_first_action_observed_count",
"native_goal_worker_effective_action_observed_count",
"remote_command_file_bridge_solver_trace_count",
"remote_command_file_bridge_solver_probe_ready_count",
"remote_command_file_bridge_solver_operation_count",
"remote_command_file_bridge_agent_operation_trace_count",
"remote_command_file_bridge_agent_request_count",
"remote_command_file_bridge_agent_success_count",
"remote_command_file_bridge_agent_failure_count",
"remote_command_file_bridge_agent_loopx_cli_call_count",
"remote_command_file_bridge_agent_loopx_state_read_count",
"remote_command_file_bridge_agent_loopx_state_write_count",
"remote_command_file_bridge_agent_todo_closeout_count",
"remote_command_file_bridge_agent_refresh_state_count",
"remote_command_file_bridge_agent_quota_spend_slot_count",
"remote_command_file_bridge_agent_task_facing_operation_count",
"remote_command_file_bridge_agent_task_facing_success_count",
"remote_command_file_bridge_agent_task_facing_failure_count",
"remote_command_file_bridge_driver_lifecycle_trace_count",
"remote_command_file_bridge_driver_lifecycle_checkpoint_count",
"remote_command_file_bridge_driver_lifecycle_request_count",
"remote_command_file_bridge_driver_lifecycle_success_count",
"remote_command_file_bridge_driver_lifecycle_failure_count",
"remote_command_file_bridge_driver_lifecycle_loopx_cli_call_count",
"remote_command_file_bridge_driver_lifecycle_loopx_state_read_count",
"remote_command_file_bridge_driver_lifecycle_loopx_state_write_count",
"host_local_acp_codex_exec_failure_trace_count",
"host_local_acp_codex_exec_recoverable_failure_trace_count",
"host_local_acp_codex_exec_fatal_failure_trace_count",
):
if isinstance(value.get(field), int) and not isinstance(value.get(field), bool):
compact[field] = value[field]
for field in (
"product_mode_declared_done_below_passing_reward_score",
"product_mode_no_open_todo_below_passing_reward_score",
"product_mode_host_local_idle_no_task_output_progress_score",
):
raw = value.get(field)
if isinstance(raw, (int, float)) and not isinstance(raw, bool):
compact[field] = float(raw)
for field in (
"case_result_writeback",
"counter_trust_level",
"controller_trace_schema_version",
"controller_trace_publicness",
"case_goal_state_init_status",
"case_goal_state_init_failed_phase",
"case_goal_state_schema_version",
"product_mode_lifecycle_checkpoint_missing_reason",
"product_mode_solver_activity_missing_reason",
"product_mode_declared_done_below_passing_reward_score_status",
"product_mode_no_open_todo_below_passing_reward_score_status",
"product_mode_host_local_idle_no_task_output_progress_score_status",
"product_mode_host_local_idle_no_task_output_progress_category",
"product_mode_host_local_idle_no_task_output_progress_policy",
"product_mode_declared_done_policy",
"product_mode_typed_repair_policy_id",
"product_mode_typed_repair_terminal_reason",
"product_mode_final_closeout_superseded_reason",
"controller_budget_cutoff_reason",
"benchflow_user_loop_recovery_stage",
"benchflow_user_loop_recovery_exception_type",
"benchflow_intermediate_soft_verify_policy",
"benchflow_intermediate_soft_verify_timeout_stage",
"benchflow_intermediate_soft_verify_timeout_cleanup_status",
"benchflow_intermediate_soft_verify_orphan_cleanup_status",
"remote_command_file_bridge_agent_operation_trace_status",
"remote_command_file_bridge_consumption_decision",
"remote_command_file_bridge_driver_lifecycle_execution_style",
"native_goal_worker_reasoning_effort",
"host_local_acp_codex_exec_failure_category",
"host_local_acp_bridge_progress_status",
"host_local_acp_bridge_progress_signal_source",
"last_decision",
"worker_submit_eligible_mismatch_reason",
"worker_bridge_writeback_loss_reason",
):
text = public_safe_compact_text(value.get(field), limit=100)
if text:
compact[field] = text
case_state_path = public_safe_compact_text(
value.get("case_goal_state_path"),
limit=180,
)
if (
case_state_path
and "/.codex/goals/" in case_state_path
and case_state_path.endswith("/ACTIVE_GOAL_STATE.md")
and not re.search(r"^/(Users|private|var/folders)/", case_state_path)
):
compact["case_goal_state_path"] = case_state_path
for field in (
"codex_runtime_goal_tool_calls",
"trajectory_action_category_counts",
"loopx_cli_state_usage_counts",
"remote_command_file_bridge_agent_returncode_counts",
"remote_command_file_bridge_agent_loopx_subcommand_counts",
"remote_command_file_bridge_agent_successful_loopx_subcommand_counts",
"remote_command_file_bridge_driver_lifecycle_command_counts",
"remote_command_file_bridge_driver_lifecycle_returncode_counts",
):
calls = _compact_numeric_map(value.get(field))
if calls:
compact[field] = calls
selected_p0_todo_id = public_safe_compact_text(
value.get("selected_p0_todo_id"),
limit=100,
)
if selected_p0_todo_id:
compact["selected_p0_todo_id"] = selected_p0_todo_id
planned_todo_ids = public_safe_compact_list(
value.get("planned_todo_ids"),
limit=8,
)
if planned_todo_ids:
compact["planned_todo_ids"] = planned_todo_ids
planned_todo_texts = public_safe_compact_list(
value.get("planned_todo_texts_public_safe"),
limit=8,
)
if planned_todo_texts:
compact["planned_todo_texts_public_safe"] = planned_todo_texts
command_records = _compact_loopx_command_records(
value.get("remote_command_file_bridge_agent_successful_loopx_command_records")
)
if command_records:
compact[
"remote_command_file_bridge_agent_successful_loopx_command_records"
] = command_records
raw_loopx_cli_calls = value.get("loopx_cli_calls")
if isinstance(raw_loopx_cli_calls, dict):
calls = _compact_numeric_map(raw_loopx_cli_calls)
if calls:
compact["loopx_cli_calls"] = calls
elif isinstance(raw_loopx_cli_calls, list):
calls: list[dict[str, Any]] = []
for item in raw_loopx_cli_calls[:8]:
if not isinstance(item, dict):
continue
call: dict[str, Any] = {}
round_value = item.get("round")
if (
isinstance(round_value, int)
and not isinstance(round_value, bool)
and round_value > 0
):
call["round"] = round_value
command = public_safe_compact_text(item.get("command"), limit=120)
if command:
call["command"] = command
flags = item.get("flags")
if isinstance(flags, list):
compact_flags = [
flag
for flag in (
public_safe_compact_text(flag, limit=60)
for flag in flags[:8]
)
if flag
]
if compact_flags:
call["flags"] = compact_flags
if isinstance(item.get("raw_title_copied"), bool):
call["raw_title_copied"] = item["raw_title_copied"]
if isinstance(item.get("raw_output_copied"), bool):
call["raw_output_copied"] = item["raw_output_copied"]
if call:
calls.append(call)
if calls:
compact["loopx_cli_calls"] = calls
return compact
def _compact_benchmark_preflight_guard(value: Any) -> dict[str, Any]:
if not isinstance(value, dict):
return {}
compact: dict[str, Any] = {}
for field in (
"schema_version",
"first_blocker",
"loopx_mode_kwarg",
"codex_goal_mode_invocation_surface",
"codex_goal_mode_required_invocation_surface",
"codex_goal_mode_baseline_claim_blocker",
"codex_app_server_goal_worker_plan_schema",
"runner_binary_resolution_policy",
"simulator_setting",
):
text = public_safe_compact_text(value.get(field), limit=120)
if text:
compact[field] = text
for field in (
"runner_surface_checked",
"local_execution_surface_checked",
"codex_cli_surface_checked",
"auth_surface_names_only",
"auth_values_read",
"artifact_redaction_required",
"task_material_ready_required",
"access_packet_prompt_injection_checked",
"trace_counter_extraction_contract_checked",
"loopx_mode_kwarg_checked",
"codex_goal_mode_invocation_surface_checked",
"codex_app_server_goal_baseline_requested",
"codex_app_server_goal_worker_adapter_present",
"codex_app_server_goal_worker_adapter_absent",
"codex_app_server_goal_worker_turn_start_required",
"codex_app_server_goal_proof_present",
"codex_goal_mode_baseline_claim_allowed",
"loopx_access_packet_absent",
"loopx_cli_bridge_absent",
"active_cli_bridge_enabled",
"claim_requires_worker_cli_calls",
"real_interface_use_observed",
"uplift_claim_allowed",
"active_user_assisted_treatment",
"simulator_to_worker_injection_channel_available",
"interactive_user_message_injection_checked",
"initial_prompt_only_is_not_active_intervention",
"no_oracle_audit_required",
"assisted_score_kept_separate_from_official",
"uvx_cli_present",
"uvx_version_probe_ok",
"docker_cli_present",
"docker_version_probe_ok",
"docker_server_available",
"colima_cli_present",
"colima_status_probe_ok",
"codex_cli_present",
"codex_version_probe_ok",
):
if isinstance(value.get(field), bool):
compact[field] = value[field]
text = public_safe_compact_text(value.get("worker_cli_bridge_surface"), limit=120)
if text:
compact["worker_cli_bridge_surface"] = text
for field in ("required_worker_loopx_cli_call_total_min",):
if isinstance(value.get(field), int) and not isinstance(value.get(field), bool):
compact[field] = value[field]
return compact
def _compact_benchmark_compose_setup_diagnostic(value: Any) -> dict[str, Any]:
if not isinstance(value, dict):
return {}
compact: dict[str, Any] = {}
for field in (
"schema_version",
"status",
"route",
"failure_class",
"runner_prerequisite_status",
"task_setup_preflight_status",
"fingerprint_confidence",
"runner_error_len_bucket",
"primary_setup_failure_category",
"apt_failure_subtype",
"pip_failure_subtype",
"retryability",
"next_diagnostic_action",
):
text = public_safe_compact_text(value.get(field), limit=180)
if text:
compact[field] = text
for field in (
"compose_setup_failure",
"unclassified_compose_failure",
"docker_daemon_unavailable",
"apt_repository_failure",
"pip_bootstrap_failure",
"volume_mount_failure",
"environment_setup_failure",
"agent_rounds_started",
"official_score_missing",
"official_result_json_materialized",
"case_attempt_budget_should_count",
"runner_launch_preflight_passed",