Test the last three: recordings, the library, and working a sound out - #49
Merged
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The end of the ten.
samples.tssays who made a recording and what may be done with it,freesound.tsfetches them,rebuild.tsworks 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
SearchOptionshad four fields; one travelled. A length cap, a page number and a page size sat there unused —searchUrlnever 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
rebuildis 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: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
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