‹ All updates

contract 0.40.0

Contract 0.40.0

A round of agent playtesting, fixed together. ERRORS: every refusal now carries the same envelope a success does. A database the door cannot reach answers 503 with {error:{code,message,hint}} plus meta.request_id and Retry-After, instead of a bare Internal Server Error that escaped the handler entirely; the hourly rate limit answers 429 the same way with quota_exceeded, naming the ceiling that actually applied and sending Retry-After computed from the hour-aligned window. If you parsed the 429 body's error as a STRING, it is now an object like every other refusal. An opaque failure does not merely withhold information: in testing it manufactured confident wrong diagnoses, because a random failure pattern reads as a structural one. NUMBERS THAT MOVE: three_crown_rate counted a duel that summed three crowns across its rounds - possibly a LOSS - as a three-crown victory, and divided by every recorded battle. Numerator and denominator now both exclude duels and boat attacks, and head_to_head_battles is returned so the division can be checked. battles_performance also returns decided_wins and decided_losses, because denominators_note said win_rate = wins / decided_battles while the wins field includes boat wins - the rate was right and unverifiable. DECKS: battles_decks and battles_meta_decks render each card's evolution form and the deck's tower_troop, the discriminators deck_hash is actually built from, so two decks with identical-looking cards no longer differ by hash for no visible reason; battles_cards splits forms into separate rows as battles_meta_cards already did, so a card played in two forms returns two records and a form below the three-battle floor is dropped even when the merged card cleared it. WAR: war_current carries day_kind, war_day and next_war_day_opens_at beside season_id, mirroring game_clock, and decks_today is an explicit null with a decks_today_reason off a war day rather than an absent key - a training day returns a roster of zeroes otherwise shaped exactly like a clan that no-showed. war_history documents war_days_battled only when player_tag was supplied and it can actually return it. COVERAGE: elixir_coverage reports measured_span and measured_hours, so a completeness ratio of 1.000 over two days no longer reads as a fully captured week. IDENTITY: the clan named in your connection instructions is the PRIMARY player's, and any others are named too; on an account with players in two clans an omitted clan_tag now resolves to that same clan rather than an arbitrary one. ARGUMENTS: every window bound is described, including that a date-only to covers the whole named local day while an ISO instant is used as given. CAPABILITIES: the consent page lists every capability your client did not request as a checkbox you can tick, and Account -> Connections edits the capabilities of a live connection - personal, agent or integration - taking effect on its next call without a reconnect.

Breaking

The 429 rate-limit body's error changed from a bare string to the standard {code,message,hint} object. battles_cards returns one row per card FORM, so a card played as both base and Evolution now returns two rows. three_crown_rate changes value for anyone with recorded duels or boat battles.