My phone physics lab lied to me β so I made Kiro keep it honest π»
This post is written as part of the Kiroween 2026 hackathon (category: Skeleton Crew). Try it: https://seance-kiro.vercel.app Β· Code: https://github.com/devprashant19/seance Β· Demo video (2:31): https://youtu.be/wdTlGj
This post is written as part of the Kiroween 2026 hackathon (category: Skeleton Crew).
Try it: https://seance-kiro.vercel.app Β·
Code: https://github.com/devprashant19/seance Β·
Demo video (2:31): https://youtu.be/wdTlGj5SruA
The problem: a lab that was in everyone's pocket
Plenty of schools have no physics lab. But nearly every student carries an accelerometer, a gyroscope, a microphone and a camera: they're called phones. The sensors are locked behind apps and permissions, and nobody turns them into instruments: things with units, error bars and an honest answer.
SΓ©ance opens them up. You scan a QR code on a laptop. Your phone opens a 3.38 kB web page (no app, no install) and streams its sensors to the laptop. On the laptop, a 3D ghost is your phone: tilt the phone and the ghost turns; shake it and the ghost gets dizzy.
Skeleton Crew: one skeleton, two bodies
Kiroween's Skeleton Crew category asks for a lean skeleton that's flexible enough to grow two different apps. Ours:
-
packages/seance-core, the skeleton. Every sensor becomes a typed spirit with real units and real uncertainty: transports, spirits, units, DSP and uncertainty, traces. -
apps/poltergeist-lab, body one. A physics lab with a pendulum, free fall, spin, plank resonance, a "singing ruler", and a webcam photogate that needs no phone at all. Every result comes with an error bar and is judged by the Oracle. -
apps/banshee-choir, body two. A multiplayer instrument. Every phone that joins becomes a named singing ghost, and the laptop keyboard can sing along: 8 instruments, an 8-key sing pad on the phone, and shake for tremolo.
The same skeleton is under both. The lab cares about microseconds and uncertainty; the choir cares about latency and joy.
Motion Twin: seeing what the sensor actually did
While an experiment recordsβlive or in replayβa Motion Twin panel beside the live chart animates what the phone or object is physically doing, reconstructed directly from that experiment's own sensor data (gyroscope, accelerometer, microphone or camera). Every twin is labelled Reconstructed from your <sensor>, with a toggleable faint Model overlay from the fitted result. When there is no data or no detected motion, the twin stays still and shows the experiment's refusal state (for example, "No spin detected").

Motion Twin reconstructing a pendulum swing from gyroscope data (replay of a bundled synthetic demo trace).
Then we caught it lying
Here's the part I'm proudest of, because it started with a bug I'm embarrassed about.
An earlier build had a spin experiment ("Where does the spirit live?" finds where the accelerometer chip sits inside the phone). I ran it with no spin at all, and the Oracle said:
Newton approves. Error 0.00 %.
Zero against zero. The comparison was dividing nothing by nothing and calling it a perfect match.
So we took its yes away. The rule is now part of the spec and is enforced by tests:
- No data β no verdict.
- No accepted answer β no pass.
- Always show the measurement and its error bar.

When no spin is detected, the Motion Twin stays still and displays the refusal state (replay of a bundled synthetic demo trace).
Then we tested the whole path end-to-end on simulated phones whose answers we already knew: real mobile-browser pages driven by synthetic sensor data.
- The pendulum gave 9.81 Β± 0.05 m/sΒ² (truth 9.81).
- A half-metre drop gave 0.49 Β± 0.03 m (truth 0.50).
- 29/29 end-to-end checks passed.
When we filmed the demo the repo had 399 tests. Today it has 431 tests in 66 files, 62 of them property-based.
And on a real phone? My first real pendulum run, hand-held on a string, gave 15 Β± 6 m/sΒ². Because 9.81 sat inside that huge error bar, the Oracle passed it. That was technically honest and practically useless, so we wrote a new rule into the spec first (.kiro/specs/experiments/pendulum-g, Requirement 6.3). If the relative uncertainty is above 20 %, the Oracle now says "Too uncertain to judge." It also tells you how to fix the run: tie the string to a fixed point, swing gently, record longer. A property-based test guarantees it can never say "approves" above that threshold. And a real phone does measure: dropped 40 cm onto a pillow and recorded live through the MCP, it gave h = 0.43 Β± 0.03 m against 0.40 Β± 0.05 m, at a steady 60 Hz with no dropouts. That recording is now a replay test in the repo.
How Kiro built it
1. Specs before code (45 spec documents)
Every package and every experiment started as a Kiro spec: requirements.md β design.md β tasks.md. The pendulum spec, for example, states what is measured, the small-angle model and its validity range, the uncertainty budget, and which hook scaffolds the code when the spec is saved.
Writing the spec first changed the bug count more than anything else. Vibe-coding a physics experiment produces code that runs. A spec forces you to say what the right answer is and how wrong it's allowed to be, which is exactly what a test needs.
2. Steering (10 docs)
.kiro/steering/ holds physics.md, units.md, testing.md, audio.md, transports.md and more. The one that paid off most was units.md: every physical value crossing a module boundary must be a typed Quantity, never a bare number. Kiro follows that in every task.
3. Custom agents (4)
There are four agents: a physicist, a medium, a necromancer and an exorcist. The physicist's description literally says it "refuses unitless physics and inspects real traces before blaming code or physics". It has the @seance MCP tools, so it can look at real recordings instead of guessing.
4. Agent hooks (9): the honesty machine
This is where Kiro stopped being "a chat that writes code" and became part of the lab.
H4, the physics guard. Every time a file in the signal-processing code or an experiment is saved, Kiro type-checks the units and runs the property tests. A second, agent-type action reviews theory, analysis and uncertainty files against the steering docs.
H2, haunting β test. When Kiro records a real sensor trace through the MCP tool record_trace, this hook turns it into a replay regression test. That test runs the recording through the same path as the app and asserts the result is within tolerance. Its prompt even says: if it fails, do NOT loosen the tolerance or edit the trace.
The other hooks:
- a contract and replay suite when the core changes (H3);
- a public-API guard (H5);
- mood-docs sync (H6);
- a trace-schema check (H7);
- an accessibility sweep (H8);
- a write-up journal hook (H9).
5. MCP: Kiro can feel the phone
packages/seance-mcp is an MCP server with 14 tools, including read_stream, record_trace, run_experiment, trace_stats, compare_traces and sensor_passport. With it, Kiro can read a phone's live sensor stream in the room, run an experiment on it, and record what happened. Bugs that only exist on real hardware stop being "works on my machine".
6. Property-based testing (62 properties)
With fast-check, the physics gets tested as laws, not examples. Real properties from the repo:
- phone samples survive
encodeBatch β JSON β decodeBatch, exactly what the relay carries; - the reported clock-skew uncertainty between phones is never below min(RTT)/2;
- an inverse-variance weighted class mean is never less certain than its best single measurement;
- webcam photogate timing uncertainty is bounded below by 1/(fpsΒ·β12), and aliasing is flagged above fps/2;
- the newest one: for any result whose relative uncertainty is above 20 %, the Oracle never says "approves".
H4 runs the property tests of the core and the lab on every relevant save.
Honest scope note: most of the core, apps, MCP server, agents and hooks were built in Kiro, spec-first. Some later polish (UI theme, video) was done outside Kiro, and the repo's docs/kiro-journal.md says which.
Body two: the choir
Same skeleton, second body. Every phone that joins becomes a singing ghost, and the laptop keyboard sings along. Pick an instrument, slide along eight keys, shake for tremolo.
Accessibility: Ghost Ear Lab
At /hear, Ghost Ear Lab turns the physics experiments into an audio-first, keyboard-driven interface (Space, R, H, with adjustable speech rate and darkroom mode) for blind and low-vision learners.
Try it
- Open https://seance-kiro.vercel.app on a laptop (hosted on Vercel, backed by
seance-relayon AWS EC2 + CloudFrontwss://). - Scan the QR with your phone and type a name.
- Tilt and shake, then open the Lab or the Choir at
/choir/.
No phone? The webcam photogate and replay mode work laptop-only.
Code (MIT): https://github.com/devprashant19/seance. The .kiro/ folder (specs, steering, agents, hooks) is all in the repo.
Every phone is already a lab. SΓ©ance just opens it. π»
#kiro #kiroween #KiroweenHackathon26
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.




















