Every number a fraction under the 4096-bit limit (closes #3)
check / check (push) Successful in 1m11s

go/constant never rounds an integer, and x^0 returned one, so whole
numbers built from it escaped the 4096-bit limit:
(((2^0+2^0)^4096)^4096)^4096 asked for about 69 billion bits and
stalled the bot. A power now starts from the fraction 1, and a number
is exact only as a fraction whose numerator and denominator are below
4096 bits, which also refuses a literal that go/constant reads exactly
past the limit, such as 1e-1233. The bounded-work test holds the tower
and the other short inputs tried against the change.

Model: opus-5-5
This commit is contained in:
clawbot
2026-09-29 02:09:33 +00:00
parent a1125e59dd
commit 3f5e453a18
3 changed files with 67 additions and 35 deletions
+13 -12
View File
@@ -172,18 +172,19 @@ container.
computed as a double, so `2^0.5` is `1.4142135623730951`. A negative
number to a fractional power is refused, as having no real result.
Numbers are read as decimal, so `010` is ten. Input over 256 bytes is
refused and exact powers are capped, so a message cannot make the bot
do unbounded work. Whole numbers below 10<sup>21</sup> are written
exactly; other results in the shortest form that reads back as the
same double, in exponent notation from 10<sup>21</sup> up and below
10<sup>-6</sup>. Refused as too large or too small: any number whose
numerator or denominator reaches 4096 bits, wherever it appears, as
`go/constant` could hold it only rounded (`1e-1300 + 1`); a power
computed as a double whose base or result is outside the normal range
of a double, about 2.2e-308 to 1.8e308 in magnitude, where a double
keeps all its digits (`1e-400^0.5`); and a result other than zero
outside that range, as it is written through a double (`1e400`,
`2^-1400`).
refused, exact powers are capped, and every number is held as a
fraction, whole numbers too, under the 4096-bit limit below, so a
message cannot make the bot do unbounded work. Whole numbers below
10<sup>21</sup> are written exactly; other results in the shortest
form that reads back as the same double, in exponent notation from
10<sup>21</sup> up and below 10<sup>-6</sup>. Refused as too large or
too small: any number whose numerator or denominator reaches 4096
bits, wherever it appears, as `go/constant` rounds a fraction that
grows that large (`1e-1300 + 1`); a power computed as a double whose
base or result is outside the normal range of a double, about 2.2e-308
to 1.8e308 in magnitude, where a double keeps all its digits
(`1e-400^0.5`); and a result other than zero outside that range, as it
is written through a double (`1e400`, `2^-1400`).
- **Failure is an exit.** If the chat client exits or the connection to
it drops, the bot exits with an error and the container's restart
policy starts both again. `SIGTERM` stops the bot, which stops the