aqua-listen: autosave keyed on kit id and clip ids, not the content hash #51

Merged
aqua merged 7 commits from aqua/listen-autosave-key into main 2026-11-13 12:17:33 +00:00
Member

A page rebuild changed kit.hash, so the autosave key (aqua-listen:<kit>:<hash>) changed and the listener lost all answers on reload (tract page 93312816 -> 7f6ad26e).

  • Key is now aqua-listen.v2:<kit id>:<sorted clip ids>. Same clip ids = same kit = same save; a different clip-id set starts fresh and leaves the old entry untouched.
  • Migration: when the new key is empty, the fullest earlier aqua-listen:<kit>:<hash> save whose answers and pairs name only this kit's clips is adopted; an existing new-key save is never overwritten. Erase removes both so nothing resurrects.
  • Saved state: seed, answers by clip id, pairs by idA|idB. The pair value A/B/same is positional (A = first of the pair in the seed's order), so it is only stable while the manifest clip order is unchanged.
  • Logic in logic.cjs (saveKey, pickLegacySave), 20 node tests; smoke.mjs gains a headless-Chromium persistence test (reload, rebuild with a different hash, migration, erase). Mutation check: reverting to the hash key fails the node test and three smoke checks.
  • Carries the two unmerged export commits from aqua/listen-export-fallbacks (889b018, 84fc228) and a merge of main (92d4282).

🤖 Generated with Claude Code

A page rebuild changed `kit.hash`, so the autosave key (`aqua-listen:<kit>:<hash>`) changed and the listener lost all answers on reload (tract page 93312816 -> 7f6ad26e). - Key is now `aqua-listen.v2:<kit id>:<sorted clip ids>`. Same clip ids = same kit = same save; a different clip-id set starts fresh and leaves the old entry untouched. - Migration: when the new key is empty, the fullest earlier `aqua-listen:<kit>:<hash>` save whose answers and pairs name only this kit's clips is adopted; an existing new-key save is never overwritten. Erase removes both so nothing resurrects. - Saved state: seed, answers by clip id, pairs by `idA|idB`. The pair value A/B/same is positional (A = first of the pair in the seed's order), so it is only stable while the manifest clip order is unchanged. - Logic in `logic.cjs` (`saveKey`, `pickLegacySave`), 20 node tests; `smoke.mjs` gains a headless-Chromium persistence test (reload, rebuild with a different hash, migration, erase). Mutation check: reverting to the hash key fails the node test and three smoke checks. - Carries the two unmerged export commits from `aqua/listen-export-fallbacks` (889b018, 84fc228) and a merge of main (92d4282). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Android Chrome allows one scripted download per tap and gives no sign when the second is dropped; export was two back-to-back anchor clicks. Answers already autosave to localStorage and survive a reload; the smoke now checks the textarea, clipboard and reload in desktop and mobile-emulated Chromium.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A rebuilt page changed kit.hash and orphaned the listener's answers. The key is now
aqua-listen.v2:<kit id>:<sorted clip ids>; pickLegacySave adopts the fullest earlier
hash-keyed save of the same kit that names only this kit's clips. Erase also removes
adoptable legacy saves. Browser smoke covers reload, rebuild, migration and erase.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Soul findings on #51. A save whose pairSig is missing or differs keeps seed and answers
and drops its pair picks (A/B/same is positional); adopted hash-keyed saves keep pairs and
are stamped. Missing pairs / non-object answers are normalised instead of crashing main().
Erase button and confirm name this kit's saved answers. A built-page test fails a
string-built or hash-form key. README states the same-id re-render and stale-cache limits.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
aqua merged commit 71cf9caeb6 into main 2026-11-13 12:17:33 +00:00
Sign in to join this conversation.
No reviewers
No labels
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
GameCult/AquaSynth!51
No description provided.