code-coordinator 0.5.485__py3-none-any.whl → 0.5.487__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-coordinator
3
- Version: 0.5.485
3
+ Version: 0.5.487
4
4
  Summary: Coordinate Claude Code workers across multiple machines and repos.
5
5
  Author-email: John Donaghy <johnfdonaghy@gmail.com>
6
6
  License-Expression: LicenseRef-FSL-1.1-MIT
@@ -1,9 +1,9 @@
1
- code_coordinator-0.5.485.dist-info/licenses/LICENSE,sha256=851BVZZwf_pEv2ydSlMmcZrwnwSS5YJ98wdLze7lyL8,4212
1
+ code_coordinator-0.5.487.dist-info/licenses/LICENSE,sha256=851BVZZwf_pEv2ydSlMmcZrwnwSS5YJ98wdLze7lyL8,4212
2
2
  coord/__init__.py,sha256=3FN2qrrxtW87xSsSD557YcMwHLDahnFK8LvqQI7Wlf4,9783
3
3
  coord/_board_mapping.py,sha256=dA5BmLcpDpy_JoK0SbZMUOklT9Dd5o5zxlNEeFM6JPE,12403
4
4
  coord/acceptance.py,sha256=FHvFwstoJbFiGik-_a5FzKI5D5_kxSzWi2ePNKTM6hM,116533
5
5
  coord/acceptance_drivers.py,sha256=bvDN5kBPyJ7SlL78do3JVONfkwDtl1WvUlAfd-VPz-I,53239
6
- coord/agent.py,sha256=kdU2wke0r36V9SNDWiLLEOcKM0uft2s8qtnzbf9YMlQ,541706
6
+ coord/agent.py,sha256=lcMYMtPmbcweWGnfQO9iG_JDKXUfEUbONbFdum_bcSs,542696
7
7
  coord/agent_app.py,sha256=ZYdY1HHkB4MFPfR-jbEewb4hOCSr0ygtaj7ccPGTGl8,99206
8
8
  coord/agent_update.py,sha256=51ySDSoHT5kTB82nO46uwBwymvbCS2ncLAQ1E7fsAcI,37489
9
9
  coord/approved_work.py,sha256=wSoxJe2KeapPtDTfrM7mcCy-BrS6DhRvjnQr48Rnsh0,19207
@@ -14,7 +14,7 @@ coord/block_log.py,sha256=8_3pvOFBkPl9FWZ7pg0XrINiOE61X1ZXqRkoUZjVvLA,56714
14
14
  coord/board_schema.py,sha256=eCR_IM6TXELnTbAdIViS6zjVQYjKWbAM0Ok4_WhCYB4,16968
15
15
  coord/board_service.py,sha256=sZocSH9LVDS-al_acRJ08lLl8MOEHFa-yo7odkiGIhc,13798
16
16
  coord/board_wire.py,sha256=m-MvrRiE26zU5o8UdO8tYYzunczU58K5kzdFrGpFFa8,19517
17
- coord/brain.py,sha256=JHlduepWhBOZEF0rYZehlSe015lVbjXhl3Q8vl-IZWo,23797
17
+ coord/brain.py,sha256=E6ZXSY8Il4ffIKUhTs98jw-WunOqHqpSI-UI0L022hk,25706
18
18
  coord/branch_model.py,sha256=ecjmzgpdbpUdGgSNABeXFUpuB9G78pDC4OBrwRqQPgA,10522
19
19
  coord/bug_intake.py,sha256=YSjgWSrbnqQ0N4uElV5lnmygdUFkKUqIU_3RKCyhYaE,4681
20
20
  coord/cargo_cache.py,sha256=pTWcSERIMgDIi5WGPrYzVN-AfewW6k0hVgdUlpACEKU,44775
@@ -22,7 +22,8 @@ coord/ci_fix.py,sha256=ae2F6T6Fn7hu0sOjgVGffHECwzGgILBoVkQaqabRroY,19309
22
22
  coord/ci_github.py,sha256=rHGWrMvDEjEPLRjq9iMxmADJqjw-OXCxxK_hOtjbcq8,38911
23
23
  coord/ci_gitlab.py,sha256=M_5Hfj9Pst3L7GkSUGsqUE7arQOnKR_NNg8MtMPWxuk,21813
24
24
  coord/ci_store.py,sha256=wCSEcsxgi7dG_eL1lLmOmQ2YgVmdzfekycRAvriSIZU,36669
25
- coord/claim.py,sha256=m6yskt7UM3EmMgnyLnmq_-zRcKwhnB37WhHPP0WEZFo,21932
25
+ coord/claim.py,sha256=kqnBl1ti3YlJRJI-BpWI_urTL4U5rLRzbz2q8jCzk-s,23670
26
+ coord/claude_setup_token.py,sha256=dAX5458ooaOZyn-_e_xpc1CxIDiNSuyk4EQMK8n7xGM,12673
26
27
  coord/cli.py,sha256=u7VSe1XVxXv9MG-GlzwdwuT034ygVOic3bv2iAJusvA,20609
27
28
  coord/client.py,sha256=ZC8Cst-xyS_R9GpDa1klmqgZZD4q_6Q6EIVPN1ZV96c,54436
28
29
  coord/codegen.py,sha256=cB7kTCe0NHsFTlWROABWfpkAATGa2H4zJ3Y0_581WSc,94659
@@ -34,19 +35,20 @@ coord/conflict_fix.py,sha256=wx3oMwMpaljbzJu-zWUCYJ_8BmIbc604uFzQmEp7e0c,76178
34
35
  coord/dao.py,sha256=UALen4Dp5ZD8YiY8vQwbsT7qsY1JdIabJ_4NGWAHVr0,34136
35
36
  coord/db.py,sha256=1DA7K63LyUaVt9-JbiEoyArmbi_AjBEJieUvISRUfDA,148850
36
37
  coord/dead_end.py,sha256=jt9jDR19Cab2wYoytqcj15NkoC3u6fZ0JGrRxaiPEig,19532
37
- coord/decomposition_chat.py,sha256=syYoAiv4H9jqsHZAwxrIn_mlW6E7uuSSqcv3gZcUk5g,43635
38
+ coord/decomposition_chat.py,sha256=QaGVNjykFEQzVPXjyp7st3bPzg98QAOiPpeAfKV53iY,44469
38
39
  coord/deploy_manifest.py,sha256=X-deE_n6oRfDQDRSqcnLCEiLUMXbgKqgBUaoU1MD1hg,8103
39
40
  coord/deploy_units.py,sha256=ZfFueMPXKW4u8geOMEHhmgyseUPuKWNub77NDjMNrHA,24097
40
41
  coord/deprecation_telemetry.py,sha256=ZK6wmN3qzF2-Ic1iVpYSC8Y4gw1sA0sJnerErzgKAI8,4149
41
42
  coord/deps.py,sha256=WnV5u_zYw_f3oMr88Qy7EUVeb3vBj5cTq8Ts1oGAR2s,3770
42
43
  coord/diagnose.py,sha256=4-375XwtuTy34QZ-3JlHaB7XgGQwvekg2Ezkl4jSvkU,122343
43
- coord/dispatch.py,sha256=zg0OwWkwblbLsb-bffpq-cRBOyBNFXLaXZ-iTKkikeI,99086
44
+ coord/dispatch.py,sha256=Pg3n-0K1Qmm1CnkMQEZcho2bPcvjoYIcztKmDeGn9_U,103909
45
+ coord/dispatch_liveness.py,sha256=LukyWJLAz8Mvj_uBj8SQod_KaqLde_v6rGQM9zs8rCs,9771
44
46
  coord/dist_name.py,sha256=XDhumYscJahwcaKjmSw135HYsnXQjwGGxRo0Qv4b0xM,5583
45
47
  coord/dr_promote.py,sha256=xS9fFvzrY-EjSEj1XMSwD7RtjbBhhXZT76XFLnddDng,60329
46
48
  coord/dr_verify.py,sha256=sIRNLFkDZFEv_kY2Z-shsoGiPIbeE17sccnoJG2-7mI,44757
47
49
  coord/drive.py,sha256=m5LYxE9zsYf8o7lQEpF2a_TDc6Cr2Gymnp7j2S5Uqpc,314295
48
50
  coord/drive_queue.py,sha256=LFecxK0TV1wWFc25AETu91hUlzBL7E8A4C6ZoU08qwQ,352957
49
- coord/drive_state.py,sha256=kcXegGRbPQ1e6EA6ZJsJOE3lIHH4iU3-40-0b25rDPg,62015
51
+ coord/drive_state.py,sha256=KJ7jvSyWjRE-8AWC-8r2QEYO9ACZ5GqqR7tj0f_Os7M,63534
50
52
  coord/events.py,sha256=EJroWy2kahye59nRyIhAgyciO-Qe2eU0ktkqqDPkWx0,13565
51
53
  coord/failure_class.py,sha256=sKSecojnNU7RMDPsMnV-Bk5590Dtzz-qAXghGNmyzR4,37653
52
54
  coord/failure_classifier.py,sha256=zrbSJ_fiMG8jLlBQi8XE754H7b0qruYLVHrFDoPRab8,12047
@@ -66,23 +68,24 @@ coord/graph_health.py,sha256=VN9Eg3uTMlcQ3Hm-tNUhW0-LjMsBp7To_jd5-avdfkI,29823
66
68
  coord/hooks.py,sha256=fdEwUf1zGF7xFm9TqlTda94EmtH2Tl8NNVeD-JfpkvA,3968
67
69
  coord/housekeeping.py,sha256=l0a6kppy2cY_mExyoYTycB5FSM0V74CZ7WOhhp41k3s,14608
68
70
  coord/interactive.py,sha256=dH_DXk6j8aka3_IwHplgNcDDadHbi319D86VhcUzvCE,221181
71
+ coord/invariant_alarms.py,sha256=rfvoGPM0N9mH-OIGCzVQIkDv1n5CGEwDIQyu0n8L2y4,11650
69
72
  coord/issue_store.py,sha256=wEKGa6oKxIL_TLwE76a1eY3TIiGOOYPiwRfQo8YibQ0,74606
70
73
  coord/issues_sync_status.py,sha256=_6ucx7oW3TUGZZvs93wRbzR_SUQcNlz-7RptOzr4alo,9262
71
74
  coord/liveness_auditor.py,sha256=sf_xBklt37DUnrIEeD4fVp4_gWPDaXbydZgfuWAPFRE,12478
72
75
  coord/machine_fault.py,sha256=Ii24eHpWjMEG-j65pAVYU3f2JvI_eLAd2TAh3auURgQ,16944
73
76
  coord/machine_metrics.py,sha256=paWqBTZgeIi7w1pgH5QSJL59UxwetxE8bXblzzcspSI,16300
74
- coord/machine_onboard.py,sha256=vW9esln3L9ZkPVIxiWKEr3yPzlXkEewBCvELYaJkK3g,124015
77
+ coord/machine_onboard.py,sha256=g6tKitX7-Xt3vfghdBuXKFr9QZeTu7p_sIrU5w5IeSY,123948
75
78
  coord/machine_pause.py,sha256=6s7Dtr5zLs1qB2NWI2-cfbMdPyigK62FTtLjzmY6slE,47521
76
79
  coord/machine_stats.py,sha256=fqUo6YmfWdGpIjitgkcGDCqLzRcRzv4oG1bFQOTsg88,5989
77
80
  coord/merge_queue.py,sha256=8PzAi0B7bjOr8Y5xU3qSr01TxxWkYVKyt0PaEqy_iNE,436610
78
- coord/milestone_chat.py,sha256=xfVCm-L-g4SHCpBUpDHtOw7Q--1ZIUMeGe7HY2Rbkko,25310
79
- coord/milestone_dispatch.py,sha256=swVWGA1f_fNJ_XD4pBl1knUCO7PIl3Zm_LcBszK7LNk,55484
81
+ coord/milestone_chat.py,sha256=d568DGTDxT2A6FaF2vA8zzPPTrzwbCyttef49FpKZvo,26538
82
+ coord/milestone_dispatch.py,sha256=MQKOEB7crvCEvXe2di_myQgen-G1gxvj9p1pfV25ooA,57626
80
83
  coord/milestone_gate.py,sha256=W81H0t8bFes9Yf86GEBsqkWiVHjEtj6GRwrZiiGiv4A,30528
81
84
  coord/milestone_order.py,sha256=4w4J3s4eYyv4oR6jkwoxveO1arDvLH7D7hsjOOZ76Js,39111
82
- coord/mock_author.py,sha256=47yBpikn8n0rI5dgdBOU83a1cxyaagcyFgkOGTy9LZ8,34735
85
+ coord/mock_author.py,sha256=mZWSMCPsIqhpQeOgvW11geHrCrDml8v0LdJJY8TyjmA,35784
83
86
  coord/models.py,sha256=UjwvoyrjPrUCI5h2DdMkZdO_QWRjJjZv4xndInsfgtk,83418
84
- coord/network.py,sha256=2KCaXhRBnu3MlmYavlWgabMMxxfcpNsz4kQW_MoWtAI,22839
85
- coord/new_issue_chat.py,sha256=uQnS7YelSYI_VTHEDGutmM0pNiKydnG7uoEuH7qjP8c,7674
87
+ coord/network.py,sha256=s8Ujts1qalc7Q5clPIdIm8km1eSbhTuXb3BkOZanAZQ,25556
88
+ coord/new_issue_chat.py,sha256=XTajQo_4IUiONwZYVyLHN7dyFOpQYPe1FxnFjjVnYfE,8724
86
89
  coord/notify.py,sha256=mAK81PbgfwSvHvjVya2zkuN1W7Hf4zZlcbvhj_iSVQ4,248847
87
90
  coord/openapi.py,sha256=oZx_zFM_kjEaDzAsWI7i08b78Im6C9zHz68LWC45MIc,16992
88
91
  coord/overlap_fence.py,sha256=eAhyYMQu-AQrJymjQCE7Uw2AWX4mLJcXHgb3f-JcC88,5761
@@ -97,15 +100,15 @@ coord/portal_bridge.py,sha256=74GNtxhcCA688SQZakFNxr2vfSh1aOZ_6cFjwMKlLsw,27517
97
100
  coord/portal_store.py,sha256=ajlr0vBSVakL0Jj0xJP66Po5yuc-qMZM79Tj6Is5S8Q,147543
98
101
  coord/portal_sync.py,sha256=6f7g-GVCfVokQd53HYbpa22WhXON4wJMtOsz8UUlb4k,163111
99
102
  coord/pr_body_lint.py,sha256=hD1tB2Z9xPCnNsHd6tdrPtBVDJ0Ixuyyxtl6xJeMUVo,2828
100
- coord/prereqs.py,sha256=b3yMmavEGHxJ96ZaUgQOjZ4i1AsWsprj4sLKvixzQt4,49236
103
+ coord/prereqs.py,sha256=jaCw42b15px5rCzFufJaiT2fMHNn0CtS89OXd3ZUuos,57190
101
104
  coord/progress.py,sha256=_VRKzhyZtCW9oEGZWtIgyPRPEsTogl_QUZTT0OnpBJA,27057
102
105
  coord/queue_diagnose.py,sha256=g1FGopwRXFx4-YNlUq2UiNFvRSY6jyucG6It0qV9eLM,41575
103
- coord/reconcile.py,sha256=ZO_yYgqh4Qf2VXdEk0_FDW7lffw1JDHL9s8Ts7K4wnk,210947
106
+ coord/reconcile.py,sha256=9MKuaunWlsj9yudZ6cJ5pt9A6Sb8FcFcSkxuen3BDbU,216496
104
107
  coord/reconcile_tick.py,sha256=sQWfNcxetnC1vMWK0yKaqWW0HpBbDyKV5Tdc9yuWAVY,2908
105
- coord/refine_chat.py,sha256=tg1SYrYirfzATz-NB_Kc61xMRY1eDtRy80K0aGtnksQ,17234
108
+ coord/refine_chat.py,sha256=u-GFMazvNDfuaSenVebmszhuRvtcuVNEgNXZz3l5pP4,18447
106
109
  coord/release_cordon.py,sha256=iVBVsY91N91kD2fZxxrjqEk-AwFJQgqT51mKhb_77So,82766
107
110
  coord/release_propagate.py,sha256=FKla9gcnWKTpGBHJsNY6HJOElPrEehP5sXAMQFgTwyo,86507
108
- coord/release_verify.py,sha256=FoGqeszhO9hed5Iq439qz0mtfAA3VQOJAo_5zxI9dUc,40850
111
+ coord/release_verify.py,sha256=tA7QrBX_0FY7EilNqJ-oPMGIpD5K7cwP6l4dXPQh-T4,43496
109
112
  coord/release_window.py,sha256=g2flkEKjvFM-mMhKGOConJCwpNP_vlZWo5A9fVGGmAk,22688
110
113
  coord/repo_dormancy.py,sha256=gtMxkBfvu7Qbg45SiCOyYnz2X2stfVca3R9oXTqONXw,9147
111
114
  coord/repo_edit.py,sha256=04StF8WyJdlJ8R5TzVUGRXcfR6gIgA0AitD0CpZ2e7U,21352
@@ -113,16 +116,16 @@ coord/repo_onboard.py,sha256=yFCYoaoSfmT9VRuVU56A18hwaXURxMKN7PhSG4Pk7aI,96221
113
116
  coord/reports.py,sha256=7pAdEGUjWyKTqZ3EKeeg6_jrtOTC7WMKbOvonirFRsQ,170794
114
117
  coord/rest_schema.py,sha256=epdKZDnjyogHeuBDcWfAJ2Es8exyMuv54rqwatTAxZM,12348
115
118
  coord/revalidate.py,sha256=fQaYCvObqUawSZWMEOkVWFtYswz9PQQwSMApAyP5zeA,66266
116
- coord/review.py,sha256=hhsGOs80dSPW_RdF53UbdbSKO9GwXadJcmmW6YIggMY,252516
119
+ coord/review.py,sha256=HCwItlG4ZwI7oseoijot5HZ3nmIgxupZdQ4iQXxvnzc,257785
117
120
  coord/scorecard.py,sha256=axe_doBJBBFWtN21JZDRSijwDI0xaZrt2oVYbwJPW7U,20211
118
121
  coord/self_health.py,sha256=9PLVdaEReFLUY6y2QXMGVd6U1CdHAh9_8MzduwBOzAY,10651
119
- coord/serve_app.py,sha256=9jGrSoHFnPuOvkb0_8UhpIgRvrJz5KAq-ljRwI3N8MY,570088
120
- coord/smoke.py,sha256=dY2uh427wzTKiTIRbLuwgYa3Alw0gUOhrnsdUcHUPrU,162428
122
+ coord/serve_app.py,sha256=C0EXj9U8_HdDPoKlc2LkLKKGtKMx_Oj_z5Wf7omM_zk,571708
123
+ coord/smoke.py,sha256=9_T7pgp4E8igpOrMeVgTXuX__GicG1uMS97u6n-zA5E,162391
121
124
  coord/spend_ceiling.py,sha256=hfuiXlnD4or7Wqoqf6BHcOMT2CXd92FBZuVdnQVlI2M,13573
122
125
  coord/split_work.py,sha256=Gp_cNtYBe7nDxBN7cDRs8CJG3V_Y0C1QUi35fHGcvnY,8502
123
126
  coord/sql.py,sha256=VVm1wobGVjyq5vDvrvxbAxRLe_vIxxSeOCD2ZwSp9s0,64731
124
127
  coord/stage_projection.py,sha256=VSHfTufYEYP_cEVzAh8w6yFnSHx9utdyei9Mo6o7b5s,52672
125
- coord/state.py,sha256=YwB4OQLuQYk4ZgPKA80jy_klxfsz--3u5VHtdXBEc9I,394238
128
+ coord/state.py,sha256=gZkQ3Ra7r8Z1TGLQifDpxausdTdTUI74EOLKvluqelM,395539
126
129
  coord/store_migrate.py,sha256=NFB7BT41OkedR9oGl8br2xGKlBKJVVwaLhmyfgEc0Rg,39163
127
130
  coord/store_parity.py,sha256=wCmGUSYXZPtEhYMaw4H-JpY3QdcKL-op9m81nNSfM3Q,20111
128
131
  coord/test_author.py,sha256=RoxcI29e8eOnmMWbA26mGThRRCiUOTHSFHDk3BKN6_E,60168
@@ -146,8 +149,8 @@ coord/commands/audit.py,sha256=r8MzMM4XZX_upQOIOHkksjIo6bv0jT7CuTlm96ACVS0,5283
146
149
  coord/commands/backup.py,sha256=mqQJG0IOD9ryXNdJV923H6s1KpD1eHLMdCBEoCdyP8s,3270
147
150
  coord/commands/chat.py,sha256=iaYHebAIve4jzMzhyWSk8sFwpr2LnUc3y8onwHqns14,11080
148
151
  coord/commands/codegen.py,sha256=eQitFmXbPoVY0W4OoqhLVgZPNLIzCgSP5Ktq8K09S04,1933
149
- coord/commands/dispatch.py,sha256=dXMU2NsztsPC_CME3C7SN7S6EagVaYp7r-_18bMGOFA,105567
150
- coord/commands/dispatch_workers.py,sha256=NDWx95R1YZ01iVMM0xGseLhLqVRXbLlZLhkorjMBGpw,220719
152
+ coord/commands/dispatch.py,sha256=j7U3z8vAveJNBgGnMB0SKaPKS88syLEBUkujjgrQIkw,106738
153
+ coord/commands/dispatch_workers.py,sha256=67S3hAmP6uCUO6IfefAbmAgWGk5pPyX3TvqFFE1Y4g0,221623
151
154
  coord/commands/dr.py,sha256=dVPJN2eZypKBH-YfwXbceveju3noQROI2uPihN66l70,9012
152
155
  coord/commands/drive.py,sha256=r0qNudGpVEHGfe_i9GDXRR6jBtpLP2H6yZgeqLbDMsM,29381
153
156
  coord/commands/drive_queue.py,sha256=5A-q9HCfATgjaMAl5u5ibMuhOfzm1Seq4XQ0gPkLWhE,275215
@@ -157,8 +160,8 @@ coord/commands/issues.py,sha256=WzlD__t3VnkH_LcqgduMvc6tHt7THr_1yLn5QP8HGJw,3424
157
160
  coord/commands/lifecycle.py,sha256=M-SvlBT6k7yhO5TCSGCXs-w2JlnWRwicuI-9YScpvCg,26974
158
161
  coord/commands/machine.py,sha256=cVW7Bb1eO5ovCQm5K4loWW0xrHyEcf70Mqp84--c1p4,21851
159
162
  coord/commands/merge.py,sha256=cj8Fhd1EX1FZS-mKC5Fe40xcvF1yB70imChTdeyNPhY,141210
160
- coord/commands/milestone.py,sha256=gCczpfXAGqG8SQYWtsxY14N7akSSnAObrc-Zsf8GkI0,83472
161
- coord/commands/plan_followup.py,sha256=JqrAGua4bR7m3OdeiS_NcT5aGlUvE6btX_JcW1cpz_Q,71741
163
+ coord/commands/milestone.py,sha256=nryt6t-BtDX2XpiE5lItnra-ZuK7wmi6TclnMDOczN4,83678
164
+ coord/commands/plan_followup.py,sha256=WEB_wps_F-yriFJywteTKsAZbMm2ohWb74KPBnOoEew,72567
162
165
  coord/commands/plans.py,sha256=XBIGfF8unUUDJEWo6wntVKGohv7_6mC6-RyQkvwr4DA,10941
163
166
  coord/commands/portal.py,sha256=RLUD_tfJ9pH3DplHAa8n3BY58k02870Afa7ayJyNE8E,111522
164
167
  coord/commands/pr.py,sha256=J-8wMjymkT50bQdWP6KoHcX5PdfA-ChJuvym6t1byZc,19966
@@ -169,7 +172,7 @@ coord/commands/review.py,sha256=TRtYwCO_k9fYKOhBvhcTRf97o9bEtG6k574HnBJxQ74,6853
169
172
  coord/commands/scorecard.py,sha256=3IUKuUApkHfS6Yszr8ynuOZuBMSXFVEAUIjHeXoEJ7U,10860
170
173
  coord/commands/sessions.py,sha256=a9OTh7nmFd9PU0gcvfplVQrUBwjBRZsYMLRMaf0dVQY,83000
171
174
  coord/commands/setup.py,sha256=wSMP522fhRThbCEOPYE-89LXZSI3kdzyz_u4Cm8wtoo,25504
172
- coord/commands/status.py,sha256=PadP5CWqA7OziQogF80nek-ZS9UYlZNriRQE_5BeLEI,137603
175
+ coord/commands/status.py,sha256=oJvfm-6p3yOdxozXuiAxHp8OMbuJ6zXeMcsU9XH3PTo,148663
173
176
  coord/commands/store_migrate.py,sha256=yhkI1a0wv86nkMs3MtdFuZWAphNpZhoHrruEMRIzmqA,11298
174
177
  coord/commands/terminal.py,sha256=62dgo7Te3lwQe8oVzPVpjkWdgGS0oOhpCpXINRcboHA,13712
175
178
  coord/commands/test_gate.py,sha256=Novp_WYVIbwQvhleifwM80cXSZUmcyuVmUTO6qv1c-k,39555
@@ -177,7 +180,7 @@ coord/commands/tui.py,sha256=GX4LsgMk08itlURCgkOKqWgjnv38uIfFSWM3xrz9T_A,18193
177
180
  coord/dashboard/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
178
181
  coord/dashboard/fixture.py,sha256=EX8p0m004lM0cZyQJR1n8-EG-ETEpUB8l0BdBnRQwE8,31519
179
182
  coord/dashboard/index.html,sha256=XzipoURZAP46Tggas-pSMq8Fb1ETX9TyAJy2ItNVigc,31463
180
- coord/dashboard/server.py,sha256=CIWewQmgasd08PzTbEB7KL99AHZ6RhqEmxRGeCd68w0,264921
183
+ coord/dashboard/server.py,sha256=BDJM05PCp8Jav60bMwoOF01EMTQaXyTqsDe-MGvsAIE,265982
181
184
  coord/dashboard/terminal.py,sha256=wR5rfWQCZ0yO5bXCkqa0t-a1g5YAQ-20LC6icZdGWHM,14647
182
185
  coord/deploy/README.md,sha256=DG_q36KeW0LQ32ElU11wjfjULO7xGUoiPIFEGPW41k0,1391
183
186
  coord/deploy/coord-agent.service,sha256=GSo_2iqCx4zv4-85LGnaINsu-BdPHpG64I8xfULKcUk,6392
@@ -269,8 +272,8 @@ coord/skills/review-verdict-recovery/SKILL.md,sha256=Grg8GWkJLK20ct2YiigbTFfNOki
269
272
  coord/skills/tui-quadraui-workflow/SKILL.md,sha256=4hUZza9wSSnPhf0eRAOh2r_MQZxK2pXYO5g-kxmJq-U,3832
270
273
  coord/skills/update-issue/SKILL.md,sha256=VrPinEmLZrCSNDrnz96hQomyO403o5c4i0RdsnUnWA0,3642
271
274
  coord/templates/deploy-cloudflare.node.yml,sha256=icsTiWn2ziQJnpZODhhFKYlnqjt2xAXsbwlQufdxhuM,2078
272
- code_coordinator-0.5.485.dist-info/METADATA,sha256=uY2UTZqp8CTyYAeOHo80lZNP9Jync8Jr2DREYWfFRcg,27178
273
- code_coordinator-0.5.485.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
274
- code_coordinator-0.5.485.dist-info/entry_points.txt,sha256=o-Hq8pvG7ReGePvN_4iOKjLNqiq-MJ43HbPurqjNPZo,41
275
- code_coordinator-0.5.485.dist-info/top_level.txt,sha256=w5sTrXesTCebhXyYv2qufOZGo0PoD1Lxgn0Q3MAXjh4,6
276
- code_coordinator-0.5.485.dist-info/RECORD,,
275
+ code_coordinator-0.5.487.dist-info/METADATA,sha256=IGo5JsmuUjmxg9egUREXlGiCM1MRSUdGKR30Xtq202c,27178
276
+ code_coordinator-0.5.487.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
277
+ code_coordinator-0.5.487.dist-info/entry_points.txt,sha256=o-Hq8pvG7ReGePvN_4iOKjLNqiq-MJ43HbPurqjNPZo,41
278
+ code_coordinator-0.5.487.dist-info/top_level.txt,sha256=w5sTrXesTCebhXyYv2qufOZGo0PoD1Lxgn0Q3MAXjh4,6
279
+ code_coordinator-0.5.487.dist-info/RECORD,,
coord/agent.py CHANGED
@@ -26,6 +26,7 @@ from pathlib import Path
26
26
  from typing import TYPE_CHECKING, Any, Callable, Iterable
27
27
 
28
28
  from coord import cargo_cache
29
+ from coord.claude_setup_token import inject_setup_token
29
30
  from coord.config_reload import reload_config_if_stale
30
31
  from coord.models import DELIVERABLE_ANALYSIS_LABEL
31
32
  from coord.platform_paths import default_coord_dir
@@ -1771,6 +1772,23 @@ def _worker_subprocess_env(
1771
1772
  if assignment_id is not None:
1772
1773
  env["COORD_ASSIGNMENT_ID"] = assignment_id
1773
1774
 
1775
+ # #3371 Part A: adopt this host's long-lived, SUBSCRIPTION-backed
1776
+ # `claude setup-token` credential when the operator has minted one.
1777
+ # This is the only place a headless worker's environment is built, so
1778
+ # it is the only place the credential has to be threaded through.
1779
+ #
1780
+ # NOT `ANTHROPIC_API_KEY` — `CLAUDE_CODE_OAUTH_TOKEN` is the OAuth
1781
+ # channel (`claude setup-token --help`: "long-lived authentication
1782
+ # token (requires Claude subscription)"), so billing and entitlements
1783
+ # stay on the Max subscription exactly as CLAUDE.md requires. An
1784
+ # API-key-shaped token is refused rather than injected; see
1785
+ # `coord.claude_setup_token` for the #2462 scar tissue in full.
1786
+ #
1787
+ # No-ops entirely on a host that has not opted in (no token file, no
1788
+ # inherited token), so an interactive `claude login` host keeps
1789
+ # authenticating exactly as it does today.
1790
+ inject_setup_token(env)
1791
+
1774
1792
  return env
1775
1793
 
1776
1794
 
coord/brain.py CHANGED
@@ -99,6 +99,30 @@ def gather_context(config: Config) -> dict:
99
99
  machine_status[machine.name] = resp.json()
100
100
  except (httpx.HTTPError, httpx.TimeoutException):
101
101
  machine_status[machine.name] = {"status": "offline"}
102
+ continue
103
+
104
+ # #3371: best-effort cross-check of this machine's claude credential
105
+ # health, so `build_prompt` can steer the brain away from proposing
106
+ # work on a host that cannot authenticate at all — the #3367 fleet
107
+ # incident (four zero-turn/$0 dispatch failures to `precision`
108
+ # before a human noticed) happened precisely because nothing
109
+ # upstream of dispatch treated a dead credential as disqualifying.
110
+ # `/status` (fetched above) never carried this — `tool_versions`
111
+ # only lives in `/health` (#1570 B) — so this is a second request,
112
+ # not a reuse of the one above; failure here is never fatal to
113
+ # planning: `claude_credential_ok`'s own degrade-to-"assume
114
+ # healthy" stance covers a missing/failed fetch the same way it
115
+ # covers an agent that predates the probe.
116
+ try:
117
+ health_resp = httpx.get(
118
+ f"http://{machine.host}:{AGENT_PORT}/health",
119
+ timeout=5,
120
+ )
121
+ tool_versions = health_resp.json().get("tool_versions")
122
+ if tool_versions:
123
+ machine_status[machine.name]["tool_versions"] = tool_versions
124
+ except (httpx.HTTPError, httpx.TimeoutException, ValueError, AttributeError):
125
+ pass
102
126
 
103
127
  return {
104
128
  "issues_by_repo": issues_by_repo,
@@ -111,6 +135,7 @@ def build_prompt(config: Config, context: dict) -> str:
111
135
  from coord.config import IMPLICIT_PROVIDER_TYPES
112
136
  from coord.deps import blocked_repos
113
137
  from coord.models import Assignment
138
+ from coord.prereqs import claude_credential_ok
114
139
  from coord.providers import (
115
140
  machines_supporting_provider,
116
141
  provider_type_for,
@@ -164,6 +189,14 @@ def build_prompt(config: Config, context: dict) -> str:
164
189
  state = "paused (do not propose work)"
165
190
  elif status.get("status") == "offline":
166
191
  state = "offline"
192
+ elif not claude_credential_ok(status.get("tool_versions")):
193
+ # #3371: a machine whose `claude` OAuth credential cannot
194
+ # authenticate is not routable, full stop — every default-
195
+ # provider dispatch to it fails at turn 1 for $0 (the #3367
196
+ # incident). Checked before "busy"/"idle": a dead credential
197
+ # disqualifies regardless of whether it also happens to be
198
+ # running something else right now.
199
+ state = "credential dead (do not propose work — #3371)"
167
200
  elif status.get("assignment"):
168
201
  state = f"busy (working on: {status['assignment'].get('issue_title', '?')})"
169
202
  else:
coord/claim.py CHANGED
@@ -403,12 +403,18 @@ def has_active_work_followup(
403
403
  # ── Default branch lookup (uses gh) ─────────────────────────────────────────
404
404
 
405
405
 
406
- def _default_branch_lookup(repo_github: str, issue_number: int) -> list[str]:
407
- """Return remote branches whose name starts with `issue-{N}-`.
406
+ def list_matching_remote_branches(repo_github: str, issue_number: int) -> list[str]:
407
+ """Every remote branch whose name starts with `issue-{N}-`, merged or not.
408
408
 
409
409
  Uses `gh api repos/.../git/matching-refs/heads/issue-{N}-`. Empty result
410
410
  on any lookup failure — we'd rather wave through a dispatch than block
411
- on a transient GH error.
411
+ on a transient GH error. Public (#3376): `_default_branch_lookup` below
412
+ is the claim-detection caller that then drops the merged ones; the
413
+ dispatch-liveness `branch_merged` predicate
414
+ (`coord.dispatch_liveness.github_issue_liveness_fetcher`, via
415
+ `any_matching_branch_merged`) needs the UNFILTERED list instead — one
416
+ raw lookup, two different filters, rather than two independently
417
+ drifting `gh api matching-refs` call sites (#2096).
412
418
  """
413
419
  from coord import github_ops
414
420
 
@@ -432,13 +438,43 @@ def _default_branch_lookup(repo_github: str, issue_number: int) -> list[str]:
432
438
  ref = r.get("ref", "")
433
439
  if isinstance(ref, str) and ref.startswith("refs/heads/"):
434
440
  branches.append(ref[len("refs/heads/"):])
435
- # Drop branches already fully merged into the default branch — a merged
436
- # branch is finished work, not an active claim. A stale merged branch (e.g. a
437
- # PR head that wasn't auto-deleted on merge) must not block new work on the
438
- # issue forever (the chat→work block on a long-merged issue-N-* branch).
441
+ return branches
442
+
443
+
444
+ def _default_branch_lookup(repo_github: str, issue_number: int) -> list[str]:
445
+ """Return remote branches whose name starts with `issue-{N}-`, with any
446
+ already fully-merged into the default branch dropped.
447
+
448
+ A merged branch is finished work, not an active claim. A stale merged
449
+ branch (e.g. a PR head that wasn't auto-deleted on merge) must not
450
+ block new work on the issue forever (the chat→work block on a
451
+ long-merged issue-N-* branch).
452
+ """
453
+ branches = list_matching_remote_branches(repo_github, issue_number)
439
454
  return _drop_merged_branches(repo_github, branches)
440
455
 
441
456
 
457
+ def any_matching_branch_merged(repo_github: str, issue_number: int) -> bool:
458
+ """#3376: True when at least one remote branch matching `issue-{N}-*`
459
+ has already merged into the repo's default branch — the `branch_merged`
460
+ predicate `coord.dispatch_liveness.check_dispatch_liveness` needs,
461
+ backed by a live GitHub check.
462
+
463
+ Reuses the exact merge-detection `_drop_merged_branches` already
464
+ performs for claim detection (PR-merged OR `ahead_by == 0` ancestry,
465
+ survives squash merges — #3103): this is just "did filtering drop
466
+ anything", with the fail-open direction flipped to match a REFUSAL
467
+ predicate rather than a claim-signal — no matching branch at all, or
468
+ any lookup failure, returns `False` ("not merged, don't refuse
469
+ dispatch on this"), never `True`.
470
+ """
471
+ branches = list_matching_remote_branches(repo_github, issue_number)
472
+ if not branches:
473
+ return False
474
+ unmerged = set(_drop_merged_branches(repo_github, branches))
475
+ return any(b not in unmerged for b in branches)
476
+
477
+
442
478
  def _repo_default_branch(repo_github: str) -> str | None:
443
479
  """The repo's default branch via the GH API, or None on any error."""
444
480
  from coord import github_ops
@@ -0,0 +1,284 @@
1
+ """#3371 Part A: the fleet's long-lived, SUBSCRIPTION-backed `claude` credential.
2
+
3
+ Every headless leg this fleet dispatches (`coord.providers.claude`) runs as a
4
+ `claude -p` subprocess that authenticates with whatever credential the host
5
+ happens to carry. Until this module, that was *always* the interactive
6
+ `claude login` OAuth **session** in `~/.claude/.credentials.json` (macOS:
7
+ the login Keychain) — a credential that dies after some weeks with no
8
+ warning. #3371's evidence: precision's session expired, `coord status`
9
+ still read `online • idle`, and four review dispatches failed at turn 1 for
10
+ $0.00 before a human noticed.
11
+
12
+ `claude setup-token` mints the same *family* of credential with a longer
13
+ life. Its own help is explicit — "Set up a long-lived authentication token
14
+ (requires Claude subscription)" — so it is subscription-backed OAuth,
15
+ **not** an API key. That distinction is the whole reason this module exists
16
+ and is enforced mechanically below (:func:`token_problem`).
17
+
18
+ **`ANTHROPIC_API_KEY` remains explicitly unsupported, forever (#2462).**
19
+ Switching this fleet to API-key auth moves billing and entitlements off
20
+ the Max subscription; when #2462 accidentally disabled OAuth (via
21
+ `claude --bare`) every dispatch on every machine failed within the hour.
22
+ A token file whose contents look like an API key (`sk-ant-api…`) is
23
+ therefore *refused*, loudly, rather than injected — see
24
+ `coord/agent.py`'s `--setting-sources user` comment and
25
+ `coord/providers/claude.py:268` for the scar tissue this protects.
26
+
27
+ Verified against `claude` 2.1.270 on 2026-09-17 (#3371's "open questions",
28
+ answered):
29
+
30
+ * **The channel.** `CLAUDE_CODE_OAUTH_TOKEN` is a first-class credential
31
+ environment variable in the `claude` binary — it appears in its own
32
+ auth-source list next to `ANTHROPIC_API_KEY`/`ANTHROPIC_AUTH_TOKEN`, is
33
+ redacted by its secret-scrubbing list, and `/login` prints
34
+ "CLAUDE_CODE_OAUTH_TOKEN was set in your environment … this session will
35
+ use your new credentials" — i.e. the env var is the credential a session
36
+ authenticates with unless a fresh interactive login supersedes it. That
37
+ is the channel a `setup-token` credential is consumed through.
38
+ * **Minting stays interactive.** `claude setup-token` produces no output
39
+ and hangs indefinitely with stdin closed (exit via timeout only), so it
40
+ cannot be scripted. Minting is a one-time, per-host operator step; this
41
+ module only *consumes* what that step produced.
42
+ * **Lifetime is still not published anywhere.** The minted token carries no
43
+ expiry we can read, so a setup-token-backed host reports
44
+ `expires_at=None` ("no expiry known") rather than a fabricated date —
45
+ never a green "does not expire" signal. The interactive-session probe
46
+ keeps publishing `refreshTokenExpiresAt`, which is where forward expiry
47
+ visibility actually comes from today.
48
+
49
+ **Opt-in, additive, per host.** With no token file present this module is a
50
+ byte-for-byte no-op: an interactive host keeps authenticating exactly as it
51
+ does today, which is the "alongside — not replacing" requirement in #3371.
52
+ An operator adopts it on one host by writing the minted token to
53
+ :func:`setup_token_path` (``~/.coord/claude-setup-token``, mode 600) — the
54
+ same `~/.coord/` fleet-secret handling as every other per-host secret. The
55
+ token is never logged, never echoed into a briefing, and never rendered by
56
+ `coord doctor`: :class:`SetupTokenStatus` redacts it in `repr()` so it
57
+ cannot leak through an exception traceback or a debug log line either.
58
+ """
59
+
60
+ from __future__ import annotations
61
+
62
+ import os
63
+ import stat
64
+ from dataclasses import dataclass
65
+ from pathlib import Path
66
+
67
+ from coord.platform_paths import default_coord_dir
68
+
69
+ #: The environment variable `claude` reads a long-lived OAuth token from.
70
+ #: NOT `ANTHROPIC_API_KEY` — see this module's docstring.
71
+ CLAUDE_OAUTH_TOKEN_ENV = "CLAUDE_CODE_OAUTH_TOKEN"
72
+
73
+ #: Filename under the coordinator state root (`~/.coord` on POSIX) holding
74
+ #: the output of a one-time `claude setup-token` run on THIS host.
75
+ SETUP_TOKEN_FILENAME = "claude-setup-token"
76
+
77
+ #: Prefix of the credential `claude setup-token` mints (a subscription OAuth
78
+ #: token). Used only as an *advisory* shape note — an unrecognised prefix is
79
+ #: still used, because Anthropic renaming it must not take a working host out
80
+ #: of the routing pool (this module's failure mode has to be permissive for
81
+ #: everything except the one case below).
82
+ SETUP_TOKEN_PREFIX = "sk-ant-oat"
83
+
84
+ #: Prefix of an Anthropic **API key**. Hard-refused: #3371's headline
85
+ #: constraint is that the fleet's credential stays subscription-backed.
86
+ API_KEY_PREFIX = "sk-ant-api"
87
+
88
+ #: What an operator is told to do when no credential can be found at all.
89
+ MINT_HINT = (
90
+ f"run `claude setup-token` on this machine and write the token to "
91
+ f"~/.coord/{SETUP_TOKEN_FILENAME} (chmod 600), or run `claude` "
92
+ f"interactively to refresh the login session"
93
+ )
94
+
95
+
96
+ def setup_token_path() -> Path:
97
+ """Where this host's long-lived `claude setup-token` credential lives.
98
+
99
+ Resolved fresh on every call through
100
+ :func:`coord.platform_paths.default_coord_dir`, so `$COORD_DIR` (the
101
+ seam every other `~/.coord` state file already honours) redirects it
102
+ for tests and for a non-POSIX host alike.
103
+ """
104
+ return default_coord_dir() / SETUP_TOKEN_FILENAME
105
+
106
+
107
+ def token_problem(token: str) -> str | None:
108
+ """The one *disqualifying* problem with *token*, or `None`.
109
+
110
+ Exactly one thing disqualifies a token: looking like an
111
+ `ANTHROPIC_API_KEY`. Anything else — an unfamiliar prefix, an
112
+ unexpected length — degrades to "assume fine" and is reported as an
113
+ advisory note instead (:func:`token_note`), matching this package's
114
+ standing "degrade to unknown, assume fine" probe contract
115
+ (`coord.prereqs.ToolProbe.ok`). Fail-closed on shape would mean a
116
+ renamed token prefix silently removing every adopting host from the
117
+ routing pool, which is a worse failure than the one it would prevent.
118
+ """
119
+ if token.lower().startswith(API_KEY_PREFIX):
120
+ return (
121
+ f"{CLAUDE_OAUTH_TOKEN_ENV} holds what looks like an Anthropic "
122
+ "API key (sk-ant-api…), not a subscription `claude setup-token` "
123
+ "credential — API-key auth is deliberately unsupported on this "
124
+ "fleet (billing/entitlements stay on the Max subscription; "
125
+ "#2462, #3371). Mint the real thing with `claude setup-token`"
126
+ )
127
+ return None
128
+
129
+
130
+ def token_note(token: str, *, path: Path | None = None) -> str | None:
131
+ """Advisory, non-disqualifying observation about *token* / its file.
132
+
133
+ Surfaced by `coord doctor` next to a healthy credential; never blocks
134
+ injection and never takes a host out of the routing pool.
135
+ """
136
+ if path is not None:
137
+ try:
138
+ mode = path.stat().st_mode
139
+ except OSError:
140
+ mode = 0
141
+ if mode & (stat.S_IRWXG | stat.S_IRWXO):
142
+ return f"{path} is group/world-accessible — chmod 600 it"
143
+ if not token.lower().startswith(SETUP_TOKEN_PREFIX):
144
+ return (
145
+ f"does not look like a `claude setup-token` credential "
146
+ f"(expected {SETUP_TOKEN_PREFIX}…) — used anyway"
147
+ )
148
+ return None
149
+
150
+
151
+ @dataclass(frozen=True, repr=False)
152
+ class SetupTokenStatus:
153
+ """Which long-lived credential this host has, if any — never the value.
154
+
155
+ `repr()` is redacted deliberately: this object is passed around the
156
+ agent process and could otherwise end up in a traceback, a debug log,
157
+ or a `/health` payload. `token` is only ever read by
158
+ :func:`inject_setup_token`, which writes it straight into a subprocess
159
+ environment.
160
+ """
161
+
162
+ #: `"env"` (inherited from the agent's own environment), `"file"`
163
+ #: (this host's `~/.coord/claude-setup-token`), or `"absent"`.
164
+ source: str
165
+ token: str | None = None
166
+ path: Path | None = None
167
+ problem: str | None = None
168
+ note: str | None = None
169
+
170
+ @property
171
+ def present(self) -> bool:
172
+ """Is a long-lived credential configured on this host at all?"""
173
+ return self.source != "absent"
174
+
175
+ @property
176
+ def usable(self) -> bool:
177
+ """Is it configured AND not disqualified (see :func:`token_problem`)?
178
+
179
+ "Usable" is a statement about shape, not liveness — exactly like
180
+ `coord.prereqs._probe_claude_credentials_linux`'s content check of
181
+ `~/.claude/.credentials.json`. Neither can prove a credential still
182
+ authenticates without spending a billable turn, which `coord
183
+ doctor` is documented not to do.
184
+ """
185
+ return self.present and self.token is not None and self.problem is None
186
+
187
+ def describe(self) -> str:
188
+ """One-line, redacted summary safe to print or log."""
189
+ if not self.present:
190
+ return "no long-lived claude setup-token configured"
191
+ where = (
192
+ f"{CLAUDE_OAUTH_TOKEN_ENV} (agent environment)"
193
+ if self.source == "env" else str(self.path)
194
+ )
195
+ if self.problem:
196
+ return f"long-lived claude credential from {where}: {self.problem}"
197
+ suffix = f" ({self.note})" if self.note else ""
198
+ return f"long-lived claude setup-token from {where}{suffix}"
199
+
200
+ def __repr__(self) -> str: # never leak the secret, #3371
201
+ return (
202
+ f"SetupTokenStatus(source={self.source!r}, token=<redacted>, "
203
+ f"path={self.path!r}, problem={self.problem!r}, note={self.note!r})"
204
+ )
205
+
206
+
207
+ _ABSENT = SetupTokenStatus(source="absent")
208
+
209
+
210
+ def load_setup_token(
211
+ env: dict[str, str] | None = None, *, path: Path | None = None
212
+ ) -> SetupTokenStatus:
213
+ """Resolve this host's long-lived claude credential.
214
+
215
+ Precedence deliberately mirrors what `claude` itself does, and what
216
+ :func:`inject_setup_token` will do: an already-set
217
+ `CLAUDE_CODE_OAUTH_TOKEN` in the agent's environment wins over the
218
+ on-disk file, so an operator who exports it from a systemd unit gets
219
+ the behaviour they asked for and `coord doctor` reports on the
220
+ credential the next dispatch will ACTUALLY use — not a different one
221
+ sitting next to it. That single-resolution-path property is the whole
222
+ point (#2096, "one question, one answer"): a probe that disagreed with
223
+ dispatch about which credential is live is worse than no probe.
224
+
225
+ Never raises: an unreadable or empty file is `"absent"`, not an error.
226
+ """
227
+ environ = os.environ if env is None else env
228
+ from_env = (environ.get(CLAUDE_OAUTH_TOKEN_ENV) or "").strip()
229
+ if from_env:
230
+ return SetupTokenStatus(
231
+ source="env",
232
+ token=from_env,
233
+ problem=token_problem(from_env),
234
+ note=token_note(from_env),
235
+ )
236
+ token_path = setup_token_path() if path is None else path
237
+ try:
238
+ raw = token_path.read_text(encoding="utf-8")
239
+ except (OSError, UnicodeDecodeError):
240
+ return _ABSENT
241
+ token = raw.strip()
242
+ if not token:
243
+ return _ABSENT
244
+ return SetupTokenStatus(
245
+ source="file",
246
+ token=token,
247
+ path=token_path,
248
+ problem=token_problem(token),
249
+ note=token_note(token, path=token_path),
250
+ )
251
+
252
+
253
+ def inject_setup_token(
254
+ env: dict[str, str], *, status: SetupTokenStatus | None = None
255
+ ) -> str | None:
256
+ """Put this host's long-lived credential into a worker's *env*, in place.
257
+
258
+ Returns the source it used (`"env"` when the worker already inherits a
259
+ token, `"file"` when one was injected from disk) or `None` when this
260
+ host has no usable long-lived credential and the worker will
261
+ authenticate with the interactive `claude login` session exactly as it
262
+ always has.
263
+
264
+ Three properties this must keep, in priority order:
265
+
266
+ 1. **No token configured → no mutation at all.** Every host that has
267
+ not opted in must produce a byte-for-byte identical worker
268
+ environment, so adopting this cannot regress the fleet the way
269
+ #2462 did.
270
+ 2. **Never overwrite an inherited token.** If the agent process itself
271
+ carries `CLAUDE_CODE_OAUTH_TOKEN`, that is the operator's explicit
272
+ choice and the worker already inherits it.
273
+ 3. **Never inject a disqualified token** (an API key). The variable is
274
+ left exactly as it was; `coord doctor`'s claude probe reports the
275
+ problem, and the credential-health gate (#3371's Part B) takes the
276
+ host out of the routing pool rather than letting it fail at turn 1.
277
+ """
278
+ st = load_setup_token(env) if status is None else status
279
+ if not st.usable:
280
+ return None
281
+ if st.source == "env":
282
+ return "env"
283
+ env[CLAUDE_OAUTH_TOKEN_ENV] = st.token or ""
284
+ return "file"