AntFleet

Disagreement · 7739d5f2-openai-0

Monetary amounts stored as JSON floats risk precision/rounding errors

mismatch
repo 53606958·PR #2·reviewed 1 week ago

Primary finding

Monetary amounts stored as JSON floats risk precision/rounding errors

mediumdata-losshigh
  • memory/goals.json:11
  • memory/goals.json:33-34
Token and financial quantities frequently require exact decimal math. Storing them as JSON numbers (binary floats in many runtimes) can introduce rounding error (e.g., 9.28 is not exactly representable), which may cause off-by-small-epsilon comparisons for threshold checks or miscomputed aggregates.

Recommendation

Represent token amounts as strings (e.g., "9.28") parsed with a decimal library, or as integers in smallest units with an explicit decimals field (e.g., 9280000000000000000 with decimals=18). Enforce this via a JSON schema and validation in the consumer.

Counterpart finding

Future-dated timestamps in goals memory

lowmaintainabilityhigh
  • memory/goals.json:11
  • memory/goals.json:12
  • memory/goals.json:22
Both milestone updatedAt fields and the currentNote use the date 2026-05-16, which is in the future relative to the PR creation. If any tooling computes staleness, daily rates (buildModeOnDailyRate), or trend windows based on these timestamps vs. wall clock, it will produce negative durations or treat the record as永远 fresh. This is a memory file consumed by an agent loop, so semantically wrong timestamps can mislead the mode-switch logic.

Recommendation

Replace the future-dated timestamps with the actual update time, or document explicitly (in the file or in repo README) that goals.json uses a simulated in-world clock. If a simulated clock is intentional, add a clockMode field so consumers can distinguish.

Why this didn't post

This finding didn't meet AntFleet's unanimous agreement threshold. Both frontier models review every PR independently; only findings they both flag with the same severity and category are posted to the PR. This one fell through.

read the methodology →