Exponentiation, modulo, HTTP API for chats, per-chat webhooks #2
Notifications
Due Date
No due date set.
Depends on
#3 Calculator: exponentiation and modulo
sneak/simplexcalc
#4 HTTP API: server, credential, and the list of chats
sneak/simplexcalc
#5 HTTP API: a chat's recent messages, and sending a message
sneak/simplexcalc
#6 HTTP API: register, list and remove webhooks, kept across restarts
sneak/simplexcalc
#7 Webhooks: post each new incoming message
sneak/simplexcalc
Reference: sneak/simplexcalc#2
Reference in New Issue
Block a user
sneak's order, 08:11 UTC 2026-09-28, verbatim:
Definition of done:
curlexample.make checkis green, and every unit is reviewed and merged tonext. ThenexttomainPR is open, mergeable and assigned to sneak.simplexcalccontainer runs the new code on the samesimplexcalc-datavolume, so the address does not change. Its API is reachable from this host. sneak is told the API address and where to find the credential.Facts for the repo-manager:
internal/calcparses withgo/parser. In Go,^is XOR at the precedence of+, and**does not parse, so exponentiation needs a different parser. Check~/.claude/GO_PACKAGE_DEFAULTS.mdbefore adding any dependency. Keep results exact where the answer is exact. Bound the exponent so one message cannot make the bot do unbounded work, asMaxInputLengthdoes now.simplex-chatWebSocket at127.0.0.1:5225inside the container has no authentication, and it stays unexposed. The new HTTP API is the only way in.simplexcalc-datavolume: it holds the bot's address.dont-block-on-reversible-decisions).next, nevermain.Model: opus-5-5
Plan. Five units, each one PR to
nextwith an independent review. They start after #8 lands: it moves the command setup out ofcmd/simplexcalc/intointernal/cli, and these units build on that layout.Units 2 to 5 share the API package and the README's API section, so they run one after another.
Decisions (reversible; details in each unit):
^and**are exponentiation, grouping to the right and binding tighter than a sign on the left (-2^2is-4);%takes the sign of the divisor (-7 % 3is2). A small parser of our own replacesgo/parser;go/constantstill computes.PORT(default8080) and takes its credential, a bearer token, from the file named byAPI_TOKEN_FILE. Without one it refuses every request. No path is exempt.Deploy, after the last merge: rebuild the image from
next; write a random credential to/var/lib/simplexcalc/api-tokenon thesimplexcalc-datavolume; recreatesimplexcalcon the same volume with-p 127.0.0.1:8080:8080, so the API is reachable on this host only and the chat client's WebSocket stays inside the container; check end to end with a throwaway second client.Model: opus-5-5
sneak asked at 09:19 UTC for this repo to move to his account. The transfer to
sneakis requested and waits for him to accept it. Once he does, the repo issneak/simplexcalc. clawbot can then write to it only after he adds clawbot as a collaborator with write access.For the repo-manager: once
https://git.eeqj.de/sneak/simplexcalcexists, point your remotes, briefs and links there. If a push or merge is refused after the move, stop starting new workers and wait for the top manager: do not work around it. The runningsimplexcalccontainer and its volume are not affected.Model: opus-5-5