This post is my entry for the Bonus Blog Prize of the Kiroween Hackathon 2026. MatterPkg is in the Frankenstein category.
The problem
A pick-and-place robot sends "done" and the reply disappears. Did the block move? A backup robot that moves it anyway can put the block somewhere twice. One that waits forever stalls the line.
MatterPkg is a prototype that answers this with evidence instead of a timeout. It stitches together things that usually live apart: a package manager for robot apps, native compiled programs, one agent harness per robot, and a simulated device that enforces ownership at the moment a move takes effect.
What runs
- Two small compiled Linux apps, Inspect and Place (C, digest-pinned). A changed binary or the wrong CPU is refused before launch.
- Each robot is its own OS process with its own state, its own copy of the apps and its own decisions. There is no central controller. The package store only distributes apps, and the operator console can go offline once a mission starts.
- A simulated scene device. It re-checks the claim generation, the block's location and the operation key at the instant a move would take effect, and it records the effect and the receipt together.
The four outcomes
From one saved checkpoint with block 1 already sorted, the original robot is lost and its reply never arrives:
| Evidence at the backup | Result |
|---|---|
| Block still in the tray, old command fenced at the device | The backup moves it exactly once |
| Block already in its bin | The backup sends zero commands |
| Old command cannot be excluded, or the observation is missing or stale | Zero commands, the reason is recorded, another observation is requested |
| Load changed from 100 g to 137 g | The 120 g backup declines with mass_exceeds_robot_limit. A 250 g robot places the same block |
The decisions are asserted against the device's own records: final block positions, the commands each robot sent and the effects committed. They are not read from the UI.
How Kiro was used
The work followed a Kiro spec in .kiro/specs/native-robot-handoff (requirements, design, tasks). Kiro's task runner worked through the task list and delegated each task to a sub-agent, and I kept the output only when the tests agreed with it.
Two things stayed with me:
- A checked task box is not proof. Task 4.4 was marked done while the code path it described never ran correctly. I replaced that path and tested every branch in separate processes.
- An intermittent bug that only a repeat loop finds. About 2 runs in 25 failed. The native apps call
bind()beforelisten(), and the robot treated "the socket file exists" as "ready". A request could land in between and getECONNREFUSED, which ended the mission. The fix retries only a refused connection, which sends no bytes and so cannot duplicate a request. After the fix the same loop ran 80 times with no failure, and the full suite passed 15 runs in a row.
What is real and what is not
- The devices are simulated. No physical robot was involved.
- The live Megas Moves run used one Megas installation with one MCP session per robot process. It is not a separate harness on each of several physical robots.
- The public repository holds the runtime, the transport contract and the simulator. The Megas adapter stays private, so the one live-Megas test is skipped without it.
Test result at the published revision: 97 passing, 0 failing, 1 skipped.
Try it
git clone https://github.com/Amretra-Dynamics/MatterPkg cd MatterPkg npm ci && npm test && node scripts/frankenstein-demo.mjs - Repository: https://github.com/Amretra-Dynamics/MatterPkg
- Release v0.2.0: https://github.com/Amretra-Dynamics/MatterPkg/releases/tag/v0.2.0
- Demo video: https://youtu.be/1QxhxTrVOU0