Skip to content

fix(asc-register): leaderboard POST body matches Apple's actual contract - #18

Merged
wei18 merged 1 commit into
mainfrom
fix/asc-leaderboard-api-shape
May 20, 2026
Merged

wei18 merged 1 commit into
mainfrom
fix/asc-leaderboard-api-shape

Conversation

@wei18

@wei18 wei18 commented May 20, 2026

Copy link
Copy Markdown
Owner

Closes #17. Per ASC's 409 response: scoreFormat → defaultFormatter (string ELAPSED_TIME_CENTISECOND); recurrenceRule → string DAILY (best guess); nested scoreRange fields dropped. design.md §How.3.1 amended to centisecond precision. 342/342 tests. impl-notes at meetings/2026-05-20_asc-leaderboard-api-shape.impl-notes.md.

§未決 ITEM: recurrenceRule = "DAILY" is a guess; will validate on next apply.

🤖 Generated with Claude Code

…act (#17)

Closes #17.

ASC apply 2026-05-20 hit HTTP 409 with 5 specific complaints about our
guessed leaderboard shape. Apply the exact corrections per Apple's
error response:

- attribute 'scoreFormat' doesn't exist on gameCenterLeaderboards →
  rename to 'defaultFormatter'
- 'defaultFormatter' is a STRING enum, not an object wrapping
  scoreRange* → flat string 'ELAPSED_TIME_CENTISECOND'
- 'recurrenceRule' is a STRING, not an object with frequency/duration →
  flat string 'DAILY' (best guess; ASC didn't enumerate valid values,
  will validate on next apply)
- nested scoreRangeStart/End keys were unknown attributes → removed
  from create body entirely; 2-hour cap stays enforced client-side
  per design.md §How.3.1 abandon rule

Design decision recorded by Leader + user 2026-05-20: Apple's elapsed
time formatters max at ELAPSED_TIME_CENTISECOND (1/100 sec, 2 decimals).
design.md §How.3.1 amended from mm:ss.SSS to mm:ss.SS, 毫秒 to 百分秒,
upper cap 7_200_000 ms to 720_000 cs.

Internal PersonalRecord retains ms precision (no internal loss); ms→cs
conversion belongs at the LiveGameCenterClient submit boundary — that
conversion is NOT in this PR because the protocol currently takes
elapsedSeconds: Int (no ms input path exists yet). Subagent flagged
this as a separate gap for follow-up (will file as new issue).

5 of 7 UNCONFIRMED markers in ASCRegister now resolved:
- Config.scoreFormatType (now defaultFormatter): RESOLVED
- Config.recurrenceDurationDays (now recurrenceRule): RESOLVED
- ASCClient.createLeaderboard type/recurrence: RESOLVED
- ASCClient.createLeaderboard scoreRange fields: RESOLVED (removed)
- 2 remaining UNCONFIRMED untouched (gameCenterDetail endpoint +
  listLeaderboards relationship — both confirmed working on apply
  happy path; markers retained for documentation honesty)

Verified:
- swift build: 0 warnings
- swift test: 342/342 in 65 suites (was 340; +2 ConfigConsistency
  assertions for defaultFormatter and recurrenceRule)

Per AI Collaboration Mode + agent-impl-notes-log: subagent maintained
impl-notes at meetings/2026-05-20_asc-leaderboard-api-shape.impl-notes.md
with §未決 capturing the recurrenceRule = 'DAILY' guess for Leader
validation on next apply.
@wei18
wei18 merged commit a7af832 into main May 20, 2026
@wei18
wei18 deleted the fix/asc-leaderboard-api-shape branch May 20, 2026 07:09
wei18 added a commit that referenced this pull request Jun 16, 2026
…nv block (#538)

Marks #18 (board chrome vs row0 safe-area) pass: chrome bottom y=201 <
board row0 top y=218, no overlap, content below the Dynamic Island.
Annotates #4 (ResumePill clause) / #19 / #20 as blocked by the signed-out
simulator: latestInProgress() returns nil by #515 graceful-degrade design
when iCloud is signed out, so no ResumePill renders — these need an
iCloud-signed-in sim to verify. Now 21 pass / 0 fail / 22 pend.

Co-authored-by: Claude Opus 4.8 <[email protected]>
wei18 added a commit that referenced this pull request Jun 17, 2026
…es filed) (#542)

Records this session's drivable-case sweep on the current sim:
- pass: #5 rapid double-tap Leave, #28 zh-Hant strings (+ earlier #1/#2/#10/
  #18/#25/#39 from #536 work)
- fail: #22 Dynamic-Type header clip (#540), #34 timer accrues background
  time (#539)
- pend w/ findings: #8 (near-win harness can't model home-return),
  #23 (digit-pad frames ≥44pt but glyphs render blank, #540),
  #29 (no tofu, but Purchases section unlocalized, #541)

New issues: #539 (solve timer counts background time — leaderboard fairness),
#540 (Dynamic Type AX3+ header/digit-pad breakage), #541 (Purchases/IAP
section unlocalized; L10n gate misses catalog-less literals).

Co-authored-by: Claude Opus 4.8 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ASCRegister apply HTTP 409 on first leaderboard POST — wrong Apple API shape

1 participant