@feigi/fleet-ctl 3.50.1 → 3.50.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feigi/fleet-ctl",
3
- "version": "3.50.1",
3
+ "version": "3.50.2",
4
4
  "description": "Agent fleet: run-team controller, merge bot, PR reviewer, and the ticket pipeline they share",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -2183,27 +2183,18 @@ while :; do # one tick
2183
2183
  echo "WATCHER DEGRADED: core REST budget=$rl — CI polling paused, silence is NOT green"
2184
2184
  budget_out=1
2185
2185
  fi
2186
- else # budget RECOVERED waits for the per-pass gate below
2186
+ else # every RECOVERED waits for the pass gates below
2187
2187
  prs=$(gh pr list --state open --limit "$pr_cap" --json number --jq '.[].number' 2>/dev/null) || prs=ERR
2188
2188
  if [ "$prs" = ERR ]; then
2189
2189
  if [ -z "$list_out" ]; then # global latch: this cause is account-level too
2190
2190
  echo "WATCHER DEGRADED: cannot list open PRs — CI polling paused, silence is NOT green"
2191
2191
  list_out=1
2192
2192
  fi
2193
- else
2194
- if [ -n "$list_out" ]; then
2195
- echo "WATCHER RECOVERED: open-PR list readable again — CI polling resumed"
2196
- list_out=
2197
- fi
2193
+ else # a list or cap RECOVERED waits for the pass gates too
2198
2194
  count=$(printf '%s\n' "$prs" | grep -c .) || : # grep -c exits 1 on zero matches; set -e must not take it
2199
- if [ "$count" -ge "$pr_cap" ]; then
2200
- if [ -z "$cap_out" ]; then # global latch: a full page may have been cut there
2201
- echo "WATCHER DEGRADED: open-PR list hit its --limit $pr_cap — PRs past it are NOT watched, silence on them is NOT green"
2202
- cap_out=1
2203
- fi
2204
- elif [ -n "$cap_out" ]; then
2205
- echo "WATCHER RECOVERED: open-PR list under its --limit $pr_cap — every open PR watched again"
2206
- cap_out=
2195
+ if [ "$count" -ge "$pr_cap" ] && [ -z "$cap_out" ]; then # global latch: a full page may have been cut there
2196
+ echo "WATCHER DEGRADED: open-PR list hit its --limit $pr_cap — PRs past it are NOT watched, silence on them is NOT green"
2197
+ cap_out=1
2207
2198
  fi
2208
2199
  # gh pr list is GraphQL, so $rl still holds. The pass is budgeted at 4 core
2209
2200
  # REST units per listed PR on top of the 200 floor. The 4 is the measured
@@ -2220,9 +2211,9 @@ while :; do # one tick
2220
2211
  # The workflow and run lookups bill a second core bucket that
2221
2212
  # `rate_limit` does not report. Its count is only in the response
2222
2213
  # headers of a lookup that bills it: one 1-unit read per tick, 4 units
2223
- # per listed PR on the same 200 floor. Recovery for both buckets waits
2224
- # until this gate clears too, so no line says polling resumed while
2225
- # this one still pauses it.
2214
+ # per listed PR on the same 200 floor. Recovery for every global latch
2215
+ # waits until this gate clears too, so no line says polling resumed
2216
+ # while this one still pauses it.
2226
2217
  hrl=$(gh api -i 'repos/{owner}/{repo}/actions/workflows?per_page=1' 2>/dev/null | awk 'tolower($1)=="x-ratelimit-remaining:" {sub(/\r$/, "", $2); print $2; exit}')
2227
2218
  case "$hrl" in ''|*[!0-9]*) hrl=ERR;; esac # a missing header is an outage, not a budget
2228
2219
  if [ "$hrl" = ERR ] || [ "$hrl" -lt $((200 + 4 * count)) ]; then
@@ -2232,6 +2223,14 @@ while :; do # one tick
2232
2223
  hidden_out=1
2233
2224
  fi
2234
2225
  else
2226
+ if [ -n "$list_out" ]; then
2227
+ echo "WATCHER RECOVERED: open-PR list readable again — CI polling resumed"
2228
+ list_out=
2229
+ fi
2230
+ if [ -n "$cap_out" ] && [ "$count" -lt "$pr_cap" ]; then
2231
+ echo "WATCHER RECOVERED: open-PR list under its --limit $pr_cap — every open PR watched again"
2232
+ cap_out=
2233
+ fi
2235
2234
  if [ -n "$budget_out" ]; then
2236
2235
  echo "WATCHER RECOVERED: core budget=$rl — CI polling resumed"
2237
2236
  budget_out=
@@ -2361,10 +2360,14 @@ would run dry mid-pass and each emit a blind line. The DEGRADED line from each
2361
2360
  pass gate names the amount it needed and the count it needed it for — except an
2362
2361
  unreadable header, which has no amount to compare and prints `bucket=ERR` alone
2363
2362
  — so a healthy-looking `budget=999` is not read as an outage with no cause. Only the
2364
- pass gates emit RECOVERED lines, and both only once the pass will actually run:
2365
- announcing recovery at the floor, or for one bucket while the other still pauses
2366
- the pass, would report resumption on a tick whose other gate then pauses it
2367
- again — a DEGRADED/RECOVERED pair every tick.
2363
+ pass gates emit RECOVERED lines — the budget's and the unreported bucket's, and the
2364
+ open-PR list's and its cap's with them — and all of them only once the pass will
2365
+ actually run: announcing recovery at the floor, or for one bucket while the other
2366
+ still pauses the pass, would report resumption on a tick whose other gate then
2367
+ pauses it again — a DEGRADED/RECOVERED pair every tick — and announcing the list or
2368
+ its cap on the tick that reads it back would say polling resumed on a tick that
2369
+ polls nothing. A list or cap latch held across a paused tick stays latched and says
2370
+ nothing more.
2368
2371
 
2369
2372
  **Judge `ci-state` on its payload, never its exit code** — the same rule as
2370
2373
  `merge-gate.mjs` applies on the merge path, applied to the watcher. `not-green` is an