Skip to content

Test the last three: recordings, the library, and working a sound out - #49

Merged
ibrahimweng merged 1 commit into
mainfrom
claude/the-last-three
Aug 31, 2026
Merged

Test the last three: recordings, the library, and working a sound out#49
ibrahimweng merged 1 commit into
mainfrom
claude/the-last-three

Conversation

@ibrahimweng

Copy link
Copy Markdown
Owner

The end of the ten. samples.ts says who made a recording and what may be done with it, freesound.ts fetches them, rebuild.ts works out how a sound was made.

The credit path has a cost attached

A library assembled from Freesound is a mix of licences, and both ways of getting it wrong are expensive: a credit that should have been written and wasn't is an obligation quietly unmet; one written where none was owed pads a credits file until nobody reads it, and the ones that matter go down with it.

Both halves are tested against each other rather than separately — Freesound writes a licence as a deed URL coming back and as a name going out, and each was already right on its own when the fault the comments describe was live.

Three dead options removed

SearchOptions had four fields; one travelled. A length cap, a page number and a page size sat there unused — searchUrl never wrote them, the proxy never reads them, nothing ever passed one. How long a sound may be and how many come back are fixed server-side (duration:[0 TO 30], page_size: 24), so a caller asking for fifty per page got twenty-four and no way to tell.

A correction to what I claimed in #48

rebuild is the only thing here with no right answer available at runtime, so the only way to measure it is to render a voice the app owns and ask the search to find its way back. Twelve voices, either side of the transform fix:

before after
named first 58% 75%
in the three offered 83% 83%

When I fixed that transform I said it lost "every comparison between sounds that are not the same." That was an overstatement. A transform that scrambles every spectrum the same way still found the right voice more often than not — which is exactly why nothing noticed it for so long. The fix is real, and it is smaller than I made it sound.

The thresholds in the test are floors taken from the worse of those two numbers, so it fails if the search degrades and stays quiet if it improves.

Verified by breaking three things

fault tests that failed
the CC0 check back to matching the start of a string 2
a deed URL stored unread as the licence 1
a query pasted into a URL rather than escaped into it 1

One cost worth naming

The unit suite is 62 seconds now rather than ten. All of that is the recovery measurement, which renders forty candidates against each of eight voices. It's the only check there is on whether the app can do the thing it exists for, so I kept it — but it's a real change to the local loop, and easy to trim if you'd rather.

359 unit tests (was 333), 88 browser tests, build clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ux1kydvUkLRoMbHp82ofDi


Generated by Claude Code

The end of the ten. `samples.ts` says who made a recording and what may be
done with it, `freesound.ts` fetches them, and `rebuild.ts` works out how a
sound was made.

The credit path is the one with a cost attached. A library assembled from
Freesound is a mix of licences, and both ways of getting it wrong are
expensive: a credit that should have been written and was not is an
obligation quietly unmet, and one written where none was owed pads a credits
file until nobody reads it and the ones that matter go down with it. Both
halves are tested against each other rather than separately, because
Freesound writes a licence as a deed URL coming back and as a name going
out, and each was already right on its own when the fault the comments
describe was live.

`SearchOptions` had four fields and one of them travelled. A length cap, a
page number and a page size sat there unused: `searchUrl` never wrote them,
the proxy never reads them, and nothing ever passed one. How long a sound
may be and how many come back are fixed on the server, so a caller asking
for fifty per page got twenty four and no way to tell. Removed.

`rebuild` is the only thing here with no right answer available at runtime,
and the only way to measure it is to render a voice this app owns and ask
the search to find its way back. Measured on twelve voices at the length and
pitch they are offered at, either side of last week's transform fix:

  named first    58% before, 75% after
  in the three   83% before, 83% after

Which corrects something I overstated when fixing that transform. I said a
transform that scrambles every spectrum the same way lost every comparison
between sounds that differ. It did not: it still found the right voice more
often than not, which is exactly why nothing noticed it for so long. The fix
is real and it is smaller than it looked.

The thresholds in the test are floors taken from the worse of those two
numbers, so it fails if the search gets worse and stays quiet if it improves.

Verified by breaking three things: the CC0 check back to matching the start
of a string fails two, a deed URL stored unread fails one, and a query
pasted into a URL rather than escaped into it fails one.

The suite is 62 seconds now rather than ten. All of that is the recovery
measurement, which renders forty candidates against each of eight voices. It
is the only check there is on whether the app can do the thing it is for.

359 unit tests, 88 browser tests, build clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ux1kydvUkLRoMbHp82ofDi
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
beat-studio Ready Ready Preview Aug 31, 2026 12:55pm

@ibrahimweng
ibrahimweng merged commit c706827 into main Aug 31, 2026
5 checks passed
@ibrahimweng
ibrahimweng deleted the claude/the-last-three branch August 31, 2026 13:13
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.

1 participant