Commit 347e8dd
committed
Fix Strix retry evidence staleness and draft-artifact-read permission
Two adversarial-review findings against the strix_evidence_state() fix:
- strix_evidence_state() walked every Strix context node directly, so a
rerun's stale failed CheckRun attempt (GitHub keeps every prior attempt's
CheckRun node in the rollup alongside the latest one) could permanently
keep the gate "failed" even after a later retry succeeded. Extract the
CheckRun-identity dedup failed_status_checks() already used into a shared
latest_check_run_attempts() helper and evaluate only the latest attempt
per Strix CheckRun identity; failed_status_checks() now calls the same
helper instead of duplicating the dedup logic.
- active_draft_review_request()'s Actions-artifact read used the generic
target-repository read credential, but the artifact always lives in the
central .github repository regardless of which repository the PR belongs
to, and the OpenCode app installation has no Actions permission. For a
cross-repository dispatch with only the OpenCode app credential
configured, the read would fail, so the initial mention-triggered request
for a draft PR outside .github could never get past its own authorization
check. New gh_api_json_via_dispatch_token() reads through the same
central-repository dispatch credential already used to create the
repository dispatch there, which the workflow always sets to the
runner's own github.token.
Added regression tests for both: a stale failed attempt vs. a later
success (and the reverse), a running retry after a failure, and the
dispatch-token vs. read-token credential selection.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur41 parent 48ebd77 commit 347e8dd
3 files changed
Lines changed: 171 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 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 | + | |
84 | 117 | | |
85 | 118 | | |
86 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
765 | 765 | | |
766 | 766 | | |
767 | 767 | | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
768 | 785 | | |
769 | 786 | | |
770 | 787 | | |
| |||
1151 | 1168 | | |
1152 | 1169 | | |
1153 | 1170 | | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
1154 | 1215 | | |
1155 | 1216 | | |
1156 | 1217 | | |
1157 | 1218 | | |
1158 | 1219 | | |
1159 | 1220 | | |
1160 | 1221 | | |
1161 | | - | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
1162 | 1225 | | |
1163 | 1226 | | |
1164 | 1227 | | |
1165 | | - | |
| 1228 | + | |
1166 | 1229 | | |
1167 | 1230 | | |
1168 | 1231 | | |
| |||
1499 | 1562 | | |
1500 | 1563 | | |
1501 | 1564 | | |
1502 | | - | |
1503 | | - | |
1504 | | - | |
1505 | | - | |
1506 | | - | |
1507 | | - | |
1508 | | - | |
1509 | | - | |
1510 | | - | |
1511 | | - | |
1512 | | - | |
1513 | | - | |
1514 | | - | |
1515 | | - | |
1516 | | - | |
1517 | | - | |
1518 | | - | |
1519 | | - | |
1520 | | - | |
1521 | | - | |
1522 | | - | |
1523 | | - | |
1524 | | - | |
1525 | | - | |
1526 | | - | |
1527 | | - | |
1528 | | - | |
1529 | | - | |
1530 | | - | |
1531 | | - | |
1532 | | - | |
| 1565 | + | |
| 1566 | + | |
1533 | 1567 | | |
1534 | 1568 | | |
1535 | 1569 | | |
1536 | 1570 | | |
1537 | 1571 | | |
1538 | | - | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
1539 | 1575 | | |
1540 | 1576 | | |
1541 | 1577 | | |
| |||
2458 | 2494 | | |
2459 | 2495 | | |
2460 | 2496 | | |
2461 | | - | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
2462 | 2503 | | |
2463 | 2504 | | |
2464 | 2505 | | |
2465 | 2506 | | |
2466 | 2507 | | |
2467 | 2508 | | |
2468 | | - | |
| 2509 | + | |
2469 | 2510 | | |
2470 | 2511 | | |
2471 | 2512 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1058 | 1058 | | |
1059 | 1059 | | |
1060 | 1060 | | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
1061 | 1086 | | |
1062 | 1087 | | |
1063 | 1088 | | |
| |||
3821 | 3846 | | |
3822 | 3847 | | |
3823 | 3848 | | |
3824 | | - | |
| 3849 | + | |
3825 | 3850 | | |
3826 | 3851 | | |
3827 | 3852 | | |
| |||
3839 | 3864 | | |
3840 | 3865 | | |
3841 | 3866 | | |
3842 | | - | |
| 3867 | + | |
3843 | 3868 | | |
3844 | 3869 | | |
3845 | 3870 | | |
| |||
3852 | 3877 | | |
3853 | 3878 | | |
3854 | 3879 | | |
3855 | | - | |
| 3880 | + | |
3856 | 3881 | | |
3857 | 3882 | | |
3858 | 3883 | | |
| |||
3861 | 3886 | | |
3862 | 3887 | | |
3863 | 3888 | | |
| 3889 | + | |
| 3890 | + | |
| 3891 | + | |
| 3892 | + | |
| 3893 | + | |
| 3894 | + | |
| 3895 | + | |
| 3896 | + | |
| 3897 | + | |
| 3898 | + | |
| 3899 | + | |
| 3900 | + | |
| 3901 | + | |
| 3902 | + | |
| 3903 | + | |
| 3904 | + | |
| 3905 | + | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
| 3909 | + | |
| 3910 | + | |
| 3911 | + | |
| 3912 | + | |
| 3913 | + | |
| 3914 | + | |
| 3915 | + | |
| 3916 | + | |
| 3917 | + | |
| 3918 | + | |
| 3919 | + | |
| 3920 | + | |
| 3921 | + | |
3864 | 3922 | | |
3865 | 3923 | | |
3866 | 3924 | | |
| |||
0 commit comments