Cut the network, keep working: building EctoFlow with Kiro (Kiroween 2026)

2026-12-03来源 dev.toEnglish

Written for the Kiroween Hackathon 2026. Entry for Skeleton Crew, Costume Contest and the Bonus Blog Prize.

I am Parth, a student. I built EctoFlow for one question: when two teams lose signal and keep working, whose list is right?

The problem
A storm cuts the power. HQ and a field crew can no longer talk. Each side keeps sending trucks and writing orders. When the line comes back, the two records disagree. Which one is right?

EctoFlow keeps every event in a hash-chained log, merges two logs into one order that is the same on both sides, and shows every order it had to refuse, with the reason.

Video: https://youtu.be/dEibv_jfx34?si=psoUBUKMwzmllKSL
Live site: https://parthlaturiya1.github.io/ECTOFLOW/
Repo (MIT): https://github.com/parthlaturiya1/ECTOFLOW
One kernel, two apps
The kernel is 413 lines in 9 files, with no DOM and no Node code. Two very different apps use it:

Spectral Fleet: a blackout crisis map. Two devices move trucks. BLACKOUT cuts them apart. RECONNECT merges them. A banner shows the merge time (typically about 6 ms, from 1.7 to 20 ms in Chrome on one laptop), how many events joined (17), and which orders were dropped (2) and why ("road closed", "square taken").
Phantasm Synth: a ghost synth in the browser. Every knob turn and key press is a logged event. A scrub bar replays the session from the log.
An app never edits the kernel. Each app brings its own reducer, a function (state, event) => state. The kernel never learns what a truck or a knob is.

Each event holds the hash of the one before it, so changing one event changes everything after it. append returns a new log and never changes the old one (packages/ectoflow-core/src/log.ts):

ts

verify walks the chain and reports the first broken index. It never throws.

It is tamper-evident, not signed. It shows that a log was changed. It does not show who wrote it.

How Kiro helped
Specs. Four specs: core, Fleet, Synth, and the Kiro Power. They hold 45 numbered requirements in EARS form ("When X, the system shall Y"). Every task names the requirement ids, the files and the test. docs/SPEC-TO-CODE.md links each requirement to a commit and a test.

Steering. Four short files that always load. The most useful is apps.md: apps never edit the kernel.

A guard that bites. "One kernel, two apps" is easy to say, so a script checks it:

code

It fails the build if an app imports anything but the kernel index. In the video I add a bad import, it fails, I remove it, it passes.

Hooks. Four hooks in Kiro's v1 JSON format. One runs the kernel tests when the agent saves a kernel file. One runs the import guard when the agent saves an app file (.kiro/hooks/apps-import-core-index.json):

json

A detail I got wrong at first: a PostFileSave hook fires when Kiro's agent saves a file, not when you save by hand. I fixed my docs after I read the Kiro docs.

The Power. The repo ships a Kiro Power with a small MCP server over stdio. It has three tools: verify_log, reconcile_logs and explain_head. They run on the real kernel. So when I ask Kiro "is this log intact?", it runs verify_log and answers with the real result. On my tampered sample the log breaks at index 1.

"I installed the Power in the Kiro IDE and asked about tampered.json. Kiro said the log breaks at index 1.

The server keeps paths inside the workspace. It refuses folders, links that point outside, and files over 5 MB. It writes only new .json files and never overwrites.

Kiro Crew built it, and Kiro Crew judged it
I did not build this in one long chat. Kiro Crew sessions did it item by item. A lead session sent one worker at a time (core, Fleet, Synth, Power, hardening, CI, Pages, polish). Each worker got a written brief and reported back. The lead re-ran the checks before accepting.

After each round, a review panel read the code, ran it, and tried to break it. The scores of the main rounds went 5.3, 6.3, 7.2, then 7.6. I then asked for harsher panels, which gave 7.7, 6.4 and 6.8. These are scores from AI review panels, not outside judges. I use them to find bugs, not as a prize.

What the panels caught
Round one found real kernel bugs by running code: events with the same time flipped order, reconcile hid a tampered log, and ids like constructor broke state. All fixed.
Later rounds found a personal email in old commits (rewritten to a GitHub noreply address), an MCP server that could not find the workspace, and timing tests that could block a deploy.
The harsh panels said the landing page looked plain, the merge was invisible, and the synth was silent on first view. So I added a merge banner, a radio-style ops log, a "Tap the ghost to hear it" prompt, and a new landing page.
One panel found a real design limit, the lying clock. Merge order uses a claimed time and a device name, so an unsigned device can claim an earlier time and win a conflict. It is in the limits. Signed events would fix it. I have not built them. "The hardest bug was the MCP server. It could not find the workspace when Kiro started it from another folder. I fixed it and tested the path on tampered.json."]

Honest limits
Not signed. Anyone can rebuild a whole chain with new hashes.
The lying clock, above. "I listened to the synth and it sounded a bit off"
All commits are from one day (2026-11-30).
The merge time is from one browser on one laptop.
No Lighthouse run. axe-core found 0 violations on three pages.
What I learned "Writing the limits down made the project stronger. The review panels found more bugs when my docs claimed less."

Try it
Open the blackout demo and click Tamper. Then open the synth and tap the ghost. The code is on GitHub. Watch the video: https://youtu.be/dEibv_jfx34?si=psoUBUKMwzmllKSL

Built for the Kiroween Hackathon 2026. #KiroweenHackathon26 #codewithkiro

原文:https://www.a8q9.cn/en/article/cut-the-network-keep-working-building-ectoflow-with-kiro-kiroween-2026-fa7b09.html

相关文章