QWENCLOUD HACKATHON · TRACK 5 — EDGEAGENT

The vaccine fridge that argues for its own contents.

A $60 edge guardian for clinic cold chains. Local reflexes fire in sub-milliseconds; a Qwen cloud brain diagnoses each excursion like a refrigeration engineer — "defrost cycle, benign" vs "door ajar, stock at risk in 22 minutes" — and a SHA-256 hash-chained, Ed25519-signed log keeps compliance tamper-evident through blackouts.

0tests passingpytest · offline · keyless
0line coverage--cov=permafrost
0reflex p95 latencybudget: <100 ms
0chain entries verifiedverify-chain · gap-free

The magic moment

Pull the cable. The alarm still fires.

Real output from permafrost replay — the network is cut mid-run at tick 1700. The local reflex layer keeps protecting the fridge, events queue ECIES-sealed, and on reconnect the hash chain closes gap-free.

permafrost replay — offline degradation
$ permafrost replay --curve seeds/door_ajar.csv \ --db offline.db --fresh --offline-from 1700 --online-from 2100 [tick 1700] ~~ NETWORK CUT — OFFLINE mode, local rules v1 protecting ~~[tick 1813] REFLEX CRITICAL door_timer: Door open 2 min or longer[tick 1820] REFLEX WATCH fast_rise: Rapid warming >= 0.5C/min[tick 2100] ~~ RECONNECTED — syncing queued events ~~ replay done: 2160 ticks | reflex firings 2 | alarms 3 | verdicts 2 | offline ticks 400 | queue pending 0 (synced 2) | rules v1chain: OK — 2178 entries re-derived, chain intact; 1 signed daily root(s) verified
NETWORK CUT · tick 1700

The cloud disappears mid-excursion. No panic, no gap — local rules v1 take over.

Alarm still fires · tick 1813

The door-ajar reflex trips locally in <1 ms, with zero connectivity.

RECONNECTED · tick 2100

The ECIES-sealed queue drains; verdicts arrive from the Qwen brain.

Chain closes gap-free

verify-chain re-derives every hash — the blackout leaves no hole in the audit log.

Reproduce it in CI form: python scripts/verify_offline.py kills real sockets mid-replay and exits 0.

permafrost — one loop, edge to cloud and back
Permafrost hero graphic: the vaccine fridge that argues for its own contents — edge reflex loop, Qwen cloud verdicts, and the tamper-evident hash chain

What ships

Reflexes at the edge. Reasoning in the cloud. Proof in the chain.

01

Sub-millisecond reflex loop

A 10-second sampler feeds a local rules engine that trips the buzzer at 0.007 ms p95 — four orders of magnitude inside the 100 ms budget, and always before any cloud round-trip. The fridge is protected even if the internet never existed.

02

Twin discrimination

Two engineered curves spike +3.2 °C almost identically. Qwen reads the co-signals and calls one benign (defrost) and one critical (door ajar) — killing the false-alarm fatigue that gets monitors unplugged.

03

Ed25519-signed rule hot-swap

The cloud distills its own verdict history into local rules, signs the bundle, and the edge verifies the signature before hot-swapping. Unsigned, forged, or downgraded bundles are refused — and the refusal is chain-logged.

04

Offline queue + resync

Excursion events — never raw streams — are ECIES-sealed to the cloud's public key and queued through outages. On reconnect the queue drains and verdicts land, with the chain gap-free across the blackout.

05

1-byte tamper detection

Every entry extends hᵢ = SHA256(hᵢ₋₁ ‖ entry) with signed daily Merkle roots. Flip one byte anywhere and verify-chain fails, names the sequence, and exits 1 — tested across all four curves.

Honest by design

No testimonials. Just the disclosures.

These lines are quoted verbatim from the repo's README — the project states its own limits in-product.

The live model path was smoke-tested with a real DashScope call, so the wiring is verified — what this build does not contain is a full end-to-end captured live run; the deployed endpoints and judging path run the offline FakeQwen engine by design.
README.md · Honesty note — a bogus key still proves the DashScope wiring with a real 401 request_id, keylessly
Real GPIO/hardware test — no physical rig has run yet. Replay mode is the supported judging path.
README.md · Status (honest) — the Pi is showmanship; the loop is the product
Physical sensor spoofing (a heat gun on a probe) is out of scope; curve-only inference can flag a failing compressor but cannot confirm it without refrigerant telemetry — verdicts say so.
README.md · Residual risk — in-product honesty

Questions

Straight answers

Does it need an API key?
No. The entire judging path — replay, tests, bench, chain verification — runs offline and keyless on FakeQwen, a deterministic fixture-backed transport. Live Qwen is an explicit opt-in: set DASHSCOPE_API_KEY and PERMAFROST_LIVE=1 and the identical command routes through real DashScope.
What happens when the network goes down?
The local reflex layer keeps firing alarms in under a millisecond with zero connectivity, events queue ECIES-sealed, and on reconnect the queue syncs into a gap-free hash chain. scripts/verify_offline.py proves it in CI by killing real sockets mid-replay.
What exactly is FakeQwen?
A deterministic, fixture-backed stand-in for the Qwen Cloud transport that lets every one of the 331 tests run offline and byte-reproducibly. The live transport (qwen3.7-plus, qwen3.6-flash, text-embedding-v4) is wired end-to-end — a bogus key drives a real DashScope round-trip and returns an authentic 401 with a real request_id, proving the endpoint is no stub.
Is the $60 hardware claim real?
It's a bill of materials, not a shipped product: Raspberry Pi + 2× DS18B20 probes + reed switch + buzzer ≈ $60, versus $1–3k/yr commercial monitors. Honest caveat, straight from the README: no physical rig has run yet — replay mode drives the identical daemon from recorded curves and is the supported judging path.
Is the audit log really tamper-evident?
Yes, and it's tested: every entry extends a SHA-256 hash chain with Ed25519-signed daily Merkle roots. Invariant tests flip a single byte in an entry, hash, sequence number, or signed root and assert verify-chain fails and exits 1 — across all four seed curves, and gap-free through a simulated power cut (os._exit mid-replay).
How do I run it?
Python 3.12, three minutes, zero hardware: pip install -e ".[dev]" then permafrost replay --curve seeds/door_ajar.csv --db audit.db --fresh. Follow with permafrost verify-chain audit.db and pytest for the full 331-test suite. The complete judge script is in DEMO.md.

Three minutes. Zero hardware.
Zero API keys.

Clone it, replay the door-ajar curve, watch the reflex fire before the cloud answers — then try to tamper with the log.