AntFleet

Anatomy · f1aedd24-0

computeNewRange is asymmetric and the comment misdescribes it (‘two spacings wide on each side’)

mediumbug
repo 53606958·PR #6·reviewed 1 week ago

The vulnerable code

scripts/reposition.ts:173-178

Code snippet unavailable.

The reasoning

Opus

computeNewRange is asymmetric and the comment misdescribes it (‘two spacings wide on each side’)

mediumbughigh
  • scripts/reposition.ts:173-178
Comment says the range is centered on currentTick and two spacings wide on each side. Actual implementation returns [base - spacing, base + 2*spacing], i.e. 1 spacing below and 2 spacings above the snapped base — asymmetric, not centered, and total width = 3 spacings (not 4). Misleading comment + skewed range means new LP positions are biased upward in price.

Recommendation

Either fix the comment to describe actual behavior, or fix the implementation to return [base - spacing*2, base + spacing*2] (or [base - spacing, base + spacing] for a symmetric narrow range).

GPT-5

New range is not centered as documented ('two spacings each side')

lowbughigh
  • scripts/reposition.ts:177-181
The function returns [base - 1*spacing, base + 2*spacing], which is not centered and does not provide 'two spacings each side' as the comment claims. This biases the range upward and may reduce time in-range.

Recommendation

Either adjust to [base - 2*spacing, base + 2*spacing] for symmetric width, or update the comment to match the intended asymmetry.

The agreement

Both frontier models flagged this within the same line range. AntFleet's unanimous gate fired — the finding posted on the PR.

Closure

Tweet thread template

tweet 1 of 8178 / 280

Two frontier models reviewed PR #6 on 53606958. Both found this bug: medium bug: computeNewRange is asymmetric and the comment misdescribes it (‘two spacings wide on each side’)

tweet 2 of 8115 / 280

The vulnerable code (scripts/reposition.ts:173-178): (full snippet at https://www.antfleet.dev/anatomy/f1aedd24-0)

tweet 3 of 8280 / 280

What Opus saw: "Comment says the range is centered on currentTick and two spacings wide on each side. Actual implementation returns [base - spacing, base + 2*spacing], i.e. 1 spacing below and 2 spacings above the snapped base — asymmetric, not centered, and total width = 3 spa…

tweet 4 of 8227 / 280

What GPT-5 saw: "The function returns [base - 1*spacing, base + 2*spacing], which is not centered and does not provide 'two spacings each side' as the comment claims. This biases the range upward and may reduce time in-range."

tweet 5 of 897 / 280

Both flagged the same line range. AntFleet's unanimous gate fired — the finding posted on the PR.

tweet 6 of 893 / 280

The fix landed in commit pending: (view diff at https://www.antfleet.dev/anatomy/f1aedd24-0)

tweet 7 of 881 / 280

AntFleet reviews every PR with two frontier models. Only unanimous findings post.

tweet 8 of 877 / 280

Full anatomy + reasoning + diffs: https://www.antfleet.dev/anatomy/f1aedd24-0

Paste into X composer one tweet at a time. X has no multi-tweet intent API.