Repository navigation
Conversation
…ojoCodingLabs#46) Add the device-lab route and the stand-ins its screen imports to the preview stub adapters: inTurn, batterySaverOn, copyReport, keepScreenOn, openReportForm, shareReport, labSetup and labPorts. The lab runs on a made-up Examplecorp EX-1000 and an engine that answers at once; its sleep() really waits, so the per-call cap behaves as on the phone, and its clock starts at LAB_CLOCK and steps a set amount, so the report shot is the same on every run. Add five HM-SET-10 shots (ready, battery saver on, no model yet, a run in progress, the finished report) and a node test that pins the route and every adapter name the screen imports. Nothing under apps/mobile/src changes.
Joaco2603
marked this pull request as ready for review
November 30, 2026 17:36
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.
What and why
Closes #46
The preview harness can now render and photograph the Device lab (HM-SET-10). It was the only screen in
apps/mobile/src/appthe harness couldn't render, becausesrc/stubs/adapters.tslacked the names the screen imports. This adds the route, made-up stand-ins for those names, and five shots. Nothing underapps/mobile/srcchanges.Changes, all in
apps/mobile/preview:src/routes.ts: thedevice-labroute.src/stubs/adapters.ts:inTurn,batterySaverOn,copyReport,keepScreenOn,openReportForm,shareReport,labSetupandlabPorts. The phone is the made-up Examplecorp EX-1000 fromscripts/devices/fixtures/good-report.json. The plan comes from the realinitialPlan()andprofileForPlan().labPorts().sleepreally waits, and ends early when itsStopSignalfires, with the same contract as the phone's port. The lab's per-call cap runs on it, so asleep()that returned at once would cut every call.labPorts().nowis a made-up clock. It starts atLAB_CLOCK.nowand moves 250 ms on each read, so the report's date (2026-11-12), durations and first-token times come out the same on every run. Two runs ofpnpm shoot device-labgave byte-identical report shots.scene.variantpicks the state:batteryturns battery saver on,freshmeans no model yet (already in the stub), andrunningholds each engine call open until its signal aborts, so a run in progress can be shot without depending on timing.shots.mjs: fivecore(...)shots:device-lab-ready,device-lab-battery,device-lab-no-model,device-lab-runninganddevice-lab-report.device-lab.test.mjs: pins the route, checks that every name the screen imports from../adapters*is exported by the stub (named imports only, so a namespace import can't hide one), and pins the fixed clock, theStopSignalsleep and the allowed cores taken from the made-up phone. The harness has no TypeScript test runner, so these read the source.package.json: atestscript (node --test device-lab.test.mjs browser.test.mjs). Without it the new test, and the existingbrowser.test.mjs, run in no script. Glad to drop it if you'd rather keep the preview's scripts as they were.Things to know:
apps/mobile/previewisn't in the pnpm workspace, so the rootpnpm testdoesn't reach it. A missing stub name would still breakpnpm buildin the preview. Wiring the preview into CI touches the workflows, so I left it for its own issue.runningvariant, the lab's own 60 s cap on a speed call ends the run as failed after a minute. The shot is taken in under a second, so it doesn't show.Alternatives considered
stubs/device-lab.tsaliased inbuild.mjs, likemail.ts. It would keep the shared stub smaller, but the issue asks foradapters.ts, andinTurnis still imported from the shared adapters. Not done.LAB_CASESand breaks whenever they change. Not done.apps/mobile/src.runningvariant waits on the signal instead.Vision fit
Every UI change needs screenshots in both themes and both languages. With this, a change to the Device lab can show its shots like any other screen, with made-up data only.
Non-negotiables
Checklist
acceptedproposal.device-lab.test.mjsfails on the missing route and on 8 missing names (batterySaverOn,copyReport,keepScreenOn,labPorts,labSetup,openReportForm,shareReport,inTurn). With it,node --test device-lab.test.mjs browser.test.mjspasses. A second round after review: three new tests (fixed clock,StopSignalsleep, cores from the phone) failed first, then passed; 22 of 22 now.pnpm check:privacy,pnpm typecheck,pnpm lint,pnpm testandnode scripts/guard/check.mjs --patterns scripts/guard/patterns.txt. The preview isn't in the pnpm workspace, so the roottypecheckandlintdon't cover its files.pnpm buildin the preview bundles the stub, and the 20 shots run it.packages/copy, in es-419 and en, with matching keys and placeholders, and no em or en dashes. No new strings: the shots use the existing HM-SET-10 copy.Model path
packages/model,agent,skillsoreval, the prompt, the router, tool descriptions, normalizers, examples or the model file. The stub only calls exported functions from@hermit/modeland@hermit/eval.Screenshots
pnpm shoot device-labprints20 shots, 0 with errors, and every shot reports 0 contrast, 0 icons, 0 targets and 0 slips.Ready
Battery saver on
No model yet
Report, top
Report, full page
New dependencies and network calls
n/a
AI agents
Tried on an Apple silicon Mac only.
🤖 Generated with Claude Code