@feigi/fleet-ctl 3.64.1 → 3.64.3

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.
@@ -256,7 +256,7 @@ For each labeled PR clearing the hold rule, lowest first:
256
256
 
257
257
  **No rebase happened because the PR was already current? Pass the head twice.** That is the normal case in a pass, not an edge case, and `pre == post` selects a proof path built for it. Never invent a plausible-looking `pre` to make the arguments differ — a `pre` that never landed satisfies the pre-rebase leg by construction, and passing one is the single easiest way to turn a stale merge into `proved=true`.
258
258
 
259
- **Read `gates`, not the flat fields.** The payload's flat fields are observations, and one of them being true or false says nothing about the verdict on its own. `gates` is the verdict's own working: `proved` is true exactly when every value in it is true. Membership is per-invocation — on the rebase path it carries `preDidNotLand` (leg 1), on the merge-commit path it carries `preIsParentOfHead` (leg 1 replaced), and on the no-rebase path it carries neither because leg 1 is dropped. That is why `preIsAncestor:true` sits next to `proved:true` on the no-rebase path and is **not** a contradiction: leg 1 wants it false, and leg 1 is not a gate on that path. A sanity check written against `preIsAncestor === false` rejects correct merges; write it against `gates` instead.
259
+ **Read `gates`, not the flat fields.** The payload's flat fields are observations, and one of them being true or false says nothing about the verdict on its own. `gates` is the verdict's own working: `proved` is true exactly when every value in it is true. Membership is per-invocation — on the rebase path it carries `preDidNotLand` (leg 1), on the merge-commit path it carries `preIsParentOfHead` (leg 1 replaced: true only when `pre` is a parent of `post` and is not an ancestor of `<merge>^1`, so a parent of `post` that was already on main fails it), and on the no-rebase path it carries neither because leg 1 is dropped. That is why `preIsAncestor:true` sits next to `proved:true` on the no-rebase path and is **not** a contradiction: leg 1 wants it false, and leg 1 is not a gate on that path. A sanity check written against `preIsAncestor === false` rejects correct merges; write it against `gates` instead.
260
260
 
261
261
  Exit **0** proved, **1** disproved, **2** the script could not evaluate the claim at all — the merge is unreachable from `origin/main`, is not a merge commit, or an argument does not resolve. Treat 2 as "ask a human", not as a disproof.
262
262
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feigi/fleet-ctl",
3
- "version": "3.64.1",
3
+ "version": "3.64.3",
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": {
@@ -15,7 +15,8 @@
15
15
  # 3. the merge commit's second parent IS the rebased head
16
16
  #
17
17
  # merge-commit path (pre != post, post has exactly two parents, and pre is one of them) — one gate replaces leg 1:
18
- # 1. pre IS a parent of post (the old version survives as an ancestor of the new)
18
+ # 1. pre IS a parent of post, and pre is NOT an ancestor of the merge's first
19
+ # parent (the old version survives in the new, and was not already on main)
19
20
  # 2. the rebased head IS an ancestor of main (the new version did)
20
21
  # 3. the merge commit's second parent IS the rebased head
21
22
  #
@@ -38,9 +39,9 @@
38
39
  # What stands in for leg 1 on each path:
39
40
  # no-rebase path — leg 1 is dropped (impossible by construction)
40
41
  # rebase path — preDidNotLand: the pre-rebase head is NOT an ancestor of main
41
- # merge-commit path — preIsParentOfHead: the pre-rebase head IS a parent of post;
42
- # the path selection already established that, so the gate
43
- # records which path ran rather than testing anything new
42
+ # merge-commit path — preIsParentOfHead: the pre-rebase head IS a parent of post
43
+ # and is NOT an ancestor of <merge>^1, so a parent of post
44
+ # that was already on main before the merge fails it
44
45
  #
45
46
  # The payload splits the checks into three kinds, because a flat object could not
46
47
  # say which of its fields were load-bearing for the verdict it sits next to:
@@ -212,7 +213,13 @@ elif [ "$post_parents" -eq 2 ] && { [ "$post_first" = "$pre_full" ] || [ "$post_
212
213
  else
213
214
  echo " merge-commit (pre != post, pre is second parent of post) — pre is a parent of post" >&2
214
215
  fi
215
- teeth=true
216
+ # Being a parent of post does not tell the PR head from main's side of the
217
+ # merge-in: both are parents. The side that was already on main is an
218
+ # ancestor of the merge's first parent, the main this merge was built on.
219
+ echo "\$ git merge-base --is-ancestor $pre $first" >&2
220
+ pre_landed=$(is_ancestor "$pre_full" "$first")
221
+ if [ "$pre_landed" = false ]; then teeth=true; else teeth=false; fi
222
+ echo " pre is-ancestor of ${merge}^1 = $pre_landed, so preIsParentOfHead = $teeth (wants pre not already on main)" >&2
216
223
  else
217
224
  proof_path="rebase"
218
225
  if [ "$pre_anc" = false ]; then teeth=true; else teeth=false; fi
@@ -228,13 +235,13 @@ if [ "$parents" -eq 2 ]; then two_parents=true; else two_parents=false; fi
228
235
  # `$teeth` is a constant true on the no-rebase path, and it is left OUT of the
229
236
  # object there rather than emitted as one: leg 1 is dropped on that path, and a
230
237
  # gate that cannot fail is not a gate. Its absence is the machine-readable form
231
- # of "leg 1 did not carry this proof". On the merge-commit path `$teeth` is a
232
- # constant true too — the elif that selects the path is itself the check that pre
233
- # is a parent of post — and it is emitted anyway, as `preIsParentOfHead`, because
234
- # the payload contract names it: it records which leg-1 replacement the proof ran
235
- # under. It cannot fail, so nothing rests on it; the four shared gates carry the
236
- # verdict there, and any parent of a two-parent post, the main side included,
237
- # satisfies it.
238
+ # of "leg 1 did not carry this proof". On the merge-commit path `$teeth` is
239
+ # emitted as `preIsParentOfHead` and is a real test: the elif that selects the
240
+ # path already established that pre is a parent of post, and on top of that
241
+ # `$teeth` is false when pre is an ancestor of the merge's first parent — main's
242
+ # side of the merge-in, a commit that landed before this merge did. The test does
243
+ # not depend on which parent position pre holds, so either merge direction is
244
+ # covered.
238
245
  gates="\"postIsAncestor\":$post_anc,\"secondParentIsHead\":$second_is_head,\"exactlyTwoParents\":$two_parents,\"headWasCurrent\":$head_current"
239
246
  if [ "$proof_path" = rebase ]; then
240
247
  gates="\"preDidNotLand\":$teeth,$gates"