Repository navigation
feat(themes): let the bedroom's sound, daylight and weather follow nature, with a cheaper shader - #17880
Conversation
The hand-drawn room takes an optional look (the row of the day and the weather) and draws the window's sky, clouds, land, stars, fireflies, yard light and rain for it. With no look the room is byte-identical to 0.2.1: 768 states compared, every switch combination, dim 0 and 0.3, with and without the shader, with titles. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t reacts to Claude and a hallway The bedroom's module moves into hooks/bedroom/core/ and hooks/bedroom/pieces/, and its shader is rebuilt with four new parts: - time of day on the real clock, or held with /bedroom time; - weather, auto or chosen with /bedroom weather; - the television flickering while Claude works and banding as the context fills (/bedroom signal); - the hallway's passes and hall light (/bedroom hall). The settings card gains rows for time and weather and on/off buttons for signal, hallway, shader and sound. /bedroom shader off draws the hour and the weather into the hand-drawn room; /bedroom sync redraws every switch from what is saved. Settings 0.2.1 saved under bedroom:saved load unchanged. The module writes no file. Co-Authored-By: Claude Opus 5.5 <[email protected]>
/bedroom sound on plays the television's click, cicadas from dusk through the night when it is dry, rain, and thunder in a storm; /bedroom sound test plays a silent file. The sounds are synthesized by code, not recorded. Nothing reaches the engine while sound is off, and it is off until turned on. macOS plays through the app; elsewhere a player found on PATH, or the soundPlayer setting, runs once per play. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…llway and sound The README gains a section for the new pieces, the seven-row card and the new /bedroom words; a minor change fragment lists the additions and the one changed answer (a switch already in the state asked stays as it is). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…der out of the size check The themes README gains the generated options reference for its new settings. lights.ts is one shader module generated from GLSL and loaded as a single file, so the code-metrics size check excludes it beside the other generated files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d answer The plugin's description and its catalog line no longer say the room is at dusk. The change fragment lists the card's seven rows, instant off kept across sessions, and reset's wider reach. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ts own loop Each sound now plays through $.process.spawn, whose child the engine ends when the read of its output stops or the module unloads; process.run had no way to end a clip, so sound off waited for it. The Windows player is WPF's MediaPlayer, which takes a volume, repeats a loop itself and writes a dot every 200 ms, so a stop lands within one beat; ffplay repeats with -loop 0 and writes its status line. Off, a change of loop, recording or volume, and unloading end the playing child. The loop follows the weather as soon as it changes: rain, a downpour and a storm each have their own loop, cicadas play only when dry from dusk through night. Before, a loop changed only at the first minute tick after the playing clip ended, and rain, downpour and storm shared one file. The loops and the thunder are cut from public-domain and CC0 recordings, two of each, chosen by /bedroom sound pick; sounds/bedroom/SOURCES.md lists each with its page and licence. The television's on and off sounds are made again: a relay click, a short quiet degauss, the flyback whine and static. /bedroom sound volume 0-100 sets every sound's volume, kept in the store. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ime from dawn to night The card was eight rows in the app and its last row was cut off. It is now six: the head (with a titles button), the switches with room for three more buttons, the time from the earliest light to night, the weather, dim, glass and blur with the signal and the hallway, and sound with its volume steps and the last answer on one line. The four title fields show on a seventh row while titles is on. The shader button is gone: shader off is a typed command for diagnosis, held for the session only and never stored, so a new session starts with the shader on. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…x-row card Also names the build time-weather-sound-2. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… takes on a loaded machine Co-Authored-By: Claude Opus 5.5 <[email protected]>
…own page states CC0 The Park Service recordings' own pages carry no license line; the public domain statement is on the index page that lists them. The second thunder is now three rolls from a freesound recording whose page states Creative Commons 0. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the room's things The sounds move into one folder per kind of the bank: cicadas (chorus, the default, and river), rain (roof), thunder (storm and distant) and the television (tube). The cicadas, the rain bed and the television are the files chosen by ear, made again sample for sample. The downpour and the storm are now the same rain on a tile roof heard from the loft, heavier: five and nine time-shifted stretches of it summed, the near taps softened, a small room's reverb, the roof's rumble lifted and a gentle low-pass. Both measure a lower crest factor and less energy above 4 kHz than the rain bed, so they sit no nearer than it; the old downpour, cut from a recording close to a small pane, rang at 1 kHz. Thunder is cut by distance, a near crack, a mid clap and far rolls, from CC0 recordings. The room's things are made by code: the lamp's and the wall light's switches, the monitor's button and degauss, the console's fan and a chime of its own, the tape going in and out. The cat's purr is cut from a CC0 recording. SOURCES.md lists each file's page, range, processing and licence. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…h the picture A one-shot was late by the second a player process takes to start. On Windows, and under WSL through Windows, one PowerShell mixer now runs for as long as sound is on: WPF players opened ahead, mixed by Windows. The engine closes a spawned child's standard input once it is written, so the mod writes each command into a file the mixer names and polls every 10 ms. Measured at volume 0 from WSL, a command reached Play() in 5 to 48 ms and the player's position moved 55 to 90 ms after the write. The mixer ends on sound off (a 150 ms fade, then the child is ended), when the module unloads or the session ends (its output closes), and after 20 s without a command; none was left running after either end. The bed follows the world code sent to the shader, not the command: it waits the 3 s the window takes to start, then cross-fades over the 6 s a command's change takes or the 90 s an auto change takes. Volume changes fade. Thunder comes from one call, thunderFor(strike), 1 to 6 s after a strike, nearer and louder the shorter the wait; the minute's scheduled strikes come through it too. The room's things and the cat's purr play on their switch, quieted together by /bedroom sound objects off. /bedroom sound pick takes a kind and an entry of the bank by name. Elsewhere each sound is still a play of its own, through the engine on macOS or a player on PATH, and a bed changes with a cut. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… sound bank there With titles open, four fields on one row of the card's 1,105 px left each a quarter, less than the 371 px the console field needs for 24 characters and its set button, so the pennant fields ran off the edge. The titles now show two to a row, console and tape, then pennant and pennant-top, in place of the time and weather rows, so the card stays six rows. A sounds button on the sound row shows the bank's pickers and the objects switch in the same two rows instead; the sound row also names the bed playing. The card test estimates each row's and each field's width from the button and text sizes measured in the app. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nd six-row card The README, the changes fragment and the sound setting's description say how the bed follows the picture, how thunder follows a strike, the room's things and /bedroom sound objects, the bank and /bedroom sound pick, which platforms mix and fade, and the card's titles and sounds rows. The build is named time-weather-sound-2b. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… as the spelling check wants Co-Authored-By: Claude Opus 5.5 <[email protected]>
…bed less often Measured on the shipped bank from WSL at volume 0: with two players opened per one-shot, a click 2 s after sound on, on a loaded machine, waited up to 2.3 s for 34 files to open over the WSL share; one player each (a second opens only for a sound played again while it still plays) halves that. The mixer used 10% of a core with a bed looping and nothing else; it now reuses one file handle for the command file, steps a bed that is not fading every 100 ms (every poll within 150 ms of its end, where it loops) and readies played one-shots every 50 ms: 5.2%. One-shots measured 53 to 102 ms from the write to the player's position moving. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings in themes 0.3.0: the dusk view at every hour, weather of different weights, the wall switch lever, dusk lighting, hall pass, hall light and forced strike commands, the renamed sources.md, and the release's version and changelog. The sound code keeps the mixer, the cross-fading beds, the roof rain recordings, the sound bank and the room sounds; main's first-round recordings are dropped in favour of them. The 0.3.0 changelog fragment was consumed by the release; a new one lists what this branch adds over 0.3.0. Build label time-weather-sound-4. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ue again - /bedroom weather strike in a storm is followed by its thunder: the sound piece reads forcedStrikeAt() on each step and plays the strike's thunder once, 1 to 4 s after it shows. - A hall pass or hall light asked again while its code still shows sends the atmosphere first and keeps the cue waiting, so the shader takes it again; sendCue reports the real delay. - /bedroom tape|console to the state it is already in says so and sends nothing while the shader runs. - The README states that soundPlayer is read from the plugin's settings only, runs with no shell and only while sound is on; plugin.json names sound (off by default), the hallway and the television in its description. - The code-metrics exclude for lights.ts names its generator, and the card tests' raised limit carries the measured times. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- PowerShell gets its script as -EncodedCommand (UTF-16LE base64), so no quote in the script meets the command line. - A poll that finds the command file missing tries again on the next; the mixer reads the file when its time or length changes and at least every 100 ms, so a rewrite of the same length in one tick is not lost. - The mixer exits 0 after quit or its idle limit and 4 after an error. An exit 0 after the idle limit keeps sound on and the next sound starts a new mixer; an earlier exit or a non-zero one turns sound off with the reason. A failed write names the command file's path. - A cue asked again while its code shows replies with the time it really runs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…dd their card buttons - /bedroom weather strike, hall pass and hall light asked while the shader cannot take a cue (its first 30 s after a start, a room-alone hold, or the shader off) send nothing and say how many seconds to wait; before, the cue was dropped and the reply said it would show. The render notes each shader start for schedule.ts's cueRefusal(). - A strike outside a storm names the weather it found. - The strike lights the window's sky at 0.4 of its pulse, up from 0.15 (lights.ts regenerated; signals.gen.ts gains EVENTS). - The settings card's switch row ends with pass, door and bolt, each running its command, dim while that command would only say why not. The card stays six rows. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r's start The mod times the shader's first 30 s from its own draw; the app starts the shader some time after, by an amount not measured. A cue is now answered as ready 5 s later than that, so a cue sent at the second the reply names is not dropped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The mod already sent each thunder one-shot to the mixer, forced and scheduled, at the same gain as the storm bed. The thunder recordings hold most of their weight under 250 Hz; above it the near file sits at the bed's level and the far ones 9 to 15 dB under it, so on small speakers the storm's own rain covered them. - Thunder plays at twice the volume's gain (capped at 1), falling to the volume's own gain for the farthest strike, and through the mixer the bed dips to half for the length of the roll, then fades back. - A scheduled strike the shader does not draw (its first 30 s, or 30 s after a hurry flip) brings no thunder. - /bedroom sound names the last one-shot sent and how long ago. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ault The shader's own schedule draws about one strike in three minutes. The weather piece now adds strikes of its own in a storm through the cue a strike asked for takes, so each brings its thunder: - each minute has three slots 20 s apart from an offset hashed from the minute, each kept with the lightning setting's chance (rare 0, normal 0.75, often 1); a slot that comes within 20 s of the last strike or finds the channel busy waits and is tried twice more, and none goes within 8 s of a scheduled strike or while the shader takes no cues; - one cue holds the world channel 18 s (12 s hold, 6 s gap), so the channel carries at most about 3.3 a minute; in ten test minutes normal sent 18 extra (about 2 a minute with the shader's own) and often 24 (about 2.8); - lightning setting, /bedroom weather lightning rare|normal|often, /bedroom lightning default and reset; no card row; - the bed's duck under thunder holds until the last roll ends. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…switch `door` toggles the hall light, so it now carries a check while the light is on, as the time and weather rows mark the one in force; `pass` and `bolt` stay plain one-time buttons. A label `door: off` would push the switch row past the card's width, so the check stands for on. The hallway piece keeps when the light is on: from a press (on until it shows plus three minutes, or off), and from the shader's own hallway schedule, mirrored from its column (the minute's code hashed, 3 in 211 at dusk and evening, 1 in 211 at night and before dawn, 20 s into the minute, none in the shader's first 30 s or while it hurries). A shader start since the light came on reads as off. The scheduled-event check moves to scheduledEventShows, which now adds the hurry flip's own lag. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A room started at local midnight in `auto` (sunrise 06:30, sunset 20:30) is stepped a minute at a time for 24 hours. The test asserts the eight phase changes at their row starts (predawn 05:15, dawn 06:10, morning 07:10, noon 11:00, golden 19:00, dusk 20:30, evening 21:45, night 23:00), each read from the shader's world value in the minute it starts, and that the room's drawing is never sent again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The sunrise and sunset settings now default to `auto`: worked out from the date for 40 degrees north (the sun's declination with the orbit's eccentricity, refraction 0.833 degrees, solar noon at 12:00 standard time) and moved by the clock's daylight saving time on that date. A zone whose January offset is ahead of its July offset keeps southern daylight saving time and gets the season turned; a zone without daylight saving time reads as northern. An HH:MM setting still holds one time all year, with the same range checks. All eight phase starts derive from these as before. Tests: day lengths of the solstices and equinoxes within 4 minutes of the known values for 40 N, a 24-hour walk on a December and a June date against the season's row starts, and an HH:MM setting over the season. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…om window By day the near trees outside the bedroom window show clumps of leaves and leafy edges, and the far treeline more detail; at night more small stars fill the upper panes. Dusk and evening are unchanged. The shader's state buffer no longer special-cases the first frame: a new buffer, read as zero, sets up as a cleared one does. validate now prices the first frame as any other, 2.24 ms on a fast GPU for both (the build before was 2.25 a frame and 2.49 the first). That a new buffer reads zero in the app is not yet hand-tested. The build is time-weather-sound-5. Co-Authored-By: Claude Opus 5.5 <[email protected]>
In dry weather the bed now follows the time of day all year: - dawn and morning quiet; - noon a few distant cicadas, a quarter of the dusk level, building in twelve eased steps to full by the golden hour; - golden hour and dusk the cicadas at full, unchanged at dusk; - across the 75-minute evening the cicadas cross-fade into the night insects, which sit 6 dB under the cicadas through the night and 8 dB under before dawn; - every change of level eases over the picture's own time. The night insects are a new bank kind, crickets: katydids (crickets and katydids at night in woodland, the default) and crickets (crickets alone), each cut from a CC0 recording as the cicada beds were (22,050 Hz mono, high-pass 900 Hz, a 20 s loop with a 1.5 s equal-power join, -34 LUFS), and credited in sources.md. The card's first bank row gains the kind; the bed reads as night insects there and in /bedroom sound. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
claude-security-review reviewed Security review: incremental since
|
|
claude-review reviewed Code review, incremental since This lane has reviewed earlier heads of this PR, so this review reports blocking findings only. I read every hunk of the incremental diff. What changed: the push puts back one assertion, which says an ffplay one-shot gets no expect(argvOf('ffplay', '/x/tv-on.wav', 1, false)).toEqual(['ffplay', '-nodisp', '-autoexit', '-loglevel', 'quiet', '-stats', '-volume', '100', '/x/tv-on.wav'])It sits beside the looping-bed case in the Earlier threads
Other notes
Verifier dropped 0 of 0 candidates. |
|
The pr-verify verifier failed head What it wrote (61 lines)This pull request leaves the merge queue, and ci-status holds it out while it carries |
Lane run report
Run 44936870222, attempt 1
Failed GitHub API callsNo failed call recorded by the run job's scripts. |
Lane-Activity: pr-unblock/address-feedback Lane-Thread: PRRT_kwDOTCGFQM66alCT Lane-Thread: PRRT_kwDOTCGFQM66alCb Lane-Thread: PRRT_kwDOTCGFQM66alCe
Lane run report
Run 44935848703, attempt 1
Failed GitHub API callsNo failed call recorded by the run job's scripts. |
|
pr-unblock / address-feedback finished round 1 of max 4 on ba782d7. |
Lane run report
Run 44937466779, attempt 1
Failed GitHub API callsNo failed call recorded by the run job's scripts. |
Lane run report
Run 44934358798, attempt 1
Failed GitHub API callsNo failed call recorded by the run job's scripts. |
- In the evening cross-fade, fade out the bed voices it replaces: rain when the weather clears, and the old night or cicadas recording when another is picked. The bed now records which cicadas it crosses from, so a cicadas pick made mid-evening cross-fades at once. - Restore the deleted tests for the paplay chain and the newer-chain stop, sound off, a change of bed and volume 0 stopping the child, volume 101 refused, and a player that cannot start. - Cover the storm re-check and the single mixer opening with tests: the weather leaving the storm between the tick and the strike brings no thunder and no dip, and a one-shot and the bed both waiting to hold the player open one mixer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The mixer re-check after an await keeps a one-shot and the bed's step from each opening a mixer, and the storm is asked again at the strike because a command between the tick and the flash can leave the storm or hurry the shader; a command after the flash leaves its thunder to roll. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Lane run report
Run 44937466779, attempt 1
Failed GitHub API callsNo failed call recorded by the run job's scripts. |
Co-Authored-By: Claude Fable 5.2 <[email protected]>
claude-review was right: GitHub Actions makes one check suite per workflow run, so `first: 3` suites filtered only by app paged over on most commits and sent them back to REST, saving almost nothing. Live on 2026-11-21 the app-only filter truncated 10 of #17880's 59 commits, both of #17939's and all 5 of #17926's. The suites now also filter by checkName, so only suites holding the model run come back (at most 3 per commit on those PRs), at first: 5. GraphQL returns one suite once per attempt, so runs are deduped by databaseId. Verified on #17880, #17939 and #17926 (66 commits): 0 truncated, the run ids match REST check-runs per commit exactly, 6 GraphQL points a query. Co-authored-by: Claude Opus 5.5 <[email protected]>
Post-merge mutation testingKilled 0, survived 7, timeout 0, no coverage 0, invalid 0, not run 0.
Surviving mutants
The run's summary has the full report. |
No related issue: the next round for the bedroom theme after #17675.
Summary
The bedroom's sound, daylight and weather follow nature more closely, the window gains leafier trees and more stars, the shader is cheaper, and the room comes back after another plugin clears the theme.
The owner hand-tested build a17e155 in the desktop app and accepted it. Since that build the head adds the removal of the unused cicada swell code and two review rounds' fixes: scheduled thunder is checked again at the strike, one mixer opens at a time, the evening cross-fade fades out the bed it replaces, deleted sound tests are restored, and the changelog line is corrected.
Fix
/bedroom sound pick cicadas riverstill plays that recording alone. The changelog now says the same./bedroom sound pick <kind> <name>chooses the recording for each kind of bed, and the settings card gains a sounds panel with the same pickers./bedroom sound objects on|off./bedroom soundends with the mixer's own report of its voices (file, volume, position) and the last file it could not open.lightningsetting and/bedroom weather lightning rare|normal|oftenset how often a held storm strikes. Thunder varies with the strike's distance and dips the bed./bedroom offis never undone.autoand move with the season, and/bedroom dateholds any day of the year.autois the real world (random until real weather is connected), and made-up weather israndom.main(themes 0.3.2).Verification
claude plugin test plugins/themesat 19712b2: 132 pass, 0 fail, in the local time zone and again in UTC. Head c0f3f20 adds only a merge ofmain; CI runs the suite on it.sound-crossfade.test.ts), thunder after the storm has gone (sound-weather.test.ts), and one mixer between a one-shot and the bed (sound-mixer.test.ts).claude plugin validate plugins/themes: picture pass 1.96 ms on the first and later frames (run at 5c31f64, before the sound-only commits).Related
plugins/themes/sounds/bedroom/sources.md🤖 Generated with Claude Code