fix(currency): a server that refused us is not a server with no currencies #280

Merged
coilysiren merged 1 commit from coilyco-ops/refused-is-not-empty into main 2026-08-13 22:52:28 +00:00 AGit
Member

closes #284 - 401 was silenced as "does not expose that action", so a refused roster was described as an empty economy

Slice of #266, which stays open: the 25-tool audit and its generic invariant test are not this.

closes #284 - 401 was silenced as "does not expose that action", so a refused roster was described as an empty economy Slice of #266, which stays open: the 25-tool audit and its generic invariant test are not this.
get_currency told a reader "no currencies have been created or traded
yet - early in the cycle" about a server whose own payload, three lines
down, carried money.activeCurrencies: 40 and economy_desc "1773 trades,
5 contracts". get_world against the same host returns HTTP 401 on all
nine datasets it tries, so the refusal was unambiguous and a sibling tool
already reported it correctly.

The narrative could not know. It reports unavailability only when
admin_ok is false, and admin_ok is bool(admin_token) — whether a token
was configured, not whether the admin surface answered. With a token
present and every read refused, it falls through to asserting the world
is empty.

The refusal was being discarded on purpose:

  # 401/404/405 just means "this server doesn't expose that action" - silent.

404 and 405 do mean that. 401 means our token was rejected, which is
exactly the case where the roster is unknown rather than absent. The
comment conflated not-exposed with not-authorised.

A snapshot now records that reads were refused, and the narrative says so
instead of describing an empty economy.

The warning stays silent, which is a narrowing I made after an existing
test caught me. test_fetch_currency_tolerates_locked_action pins a
partial 401 — mint locked, create and trade fine, roster complete — where
a warning would be noise. My first attempt surfaced one and broke it. The
flag changes the narrative only when there are no records at all, so that
contract is untouched and the test is unmodified.

Mutation: dropping the flag again fails the refused-server test and
leaves the genuinely-empty test green.

Slice of #266, which stays open: the 25-tool audit and the generic
invariant test are not this, and get_currency's holder cap is #267's
rule 3 sitting behind a cached fetch.

Refs #266

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-gaming/eco-app!280
No description provided.