Repository navigation
test(server): seed the metrics simulation from a fixed until - #168
Merged
Merged
Conversation
The seed read the wall clock: `until` defaulted to now, weekend weighting followed the run date, and the clamp for turns past `until` drew an extra random number only when a turn fell after the current time, shifting the rest of the stream with the hour. The suite now passes a fixed past `until`, the seed requires it, and the clamp draws either way, so metrics.simulation.json repeats across runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sanchitrk
force-pushed
the
fix/seed-repeatable
branch
from
November 14, 2026 17:22
7563a59 to
8a3d26f
Compare
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.
metrics.simulation.jsonchanged between runs even when nothing else did, becauseapps/server/test/machines/seed.tsread the wall clock in three places:untildefaulted toDate.now().startDay()weighted weekends by the weekday ofuntil - ago * DAY, so the result followed the run date.if (at > UNTIL) at = UNTIL - int(...)drew an extra random number only when a turn's work hour fell after the current time. That shifted the rest of the mulberry32 stream depending on the hour of the run.Changes:
until(2026-11-14T12:00Z). It is in the past, sountil()(now + 2 days) and thesince 1970reads still cover every seeded row. Live turns underCODEWORK_FIXTURE_NOWstill land today.seed.tsnow requires<until ms>.metrics.simulation.jsonis regenerated.Verified on OrbStack cw-a and cw-b, one suite at a time: run 1 (
-u, 12:40 UTC) and run 3 (no-u, 12:44 UTC) both passed and wrote byte-identical artifacts. Run 2 matched run 1 through therestoredcase. It then failed inreadded, wheretruth(cwB)got an empty result fromsqlite3overorbfor an aggregate SELECT. That looks like an existing transport flake, not something the seed causes.vp checkandvp run typecheckpass.Rebased onto #166 and regenerated the artifact at 17:18 UTC. Its seeded and first-connect totals match the 12:40 UTC run exactly, and a second run with no
-upassed all 9 tests with a byte-identical artifact.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.