THE COMMONS
An installable, mobile-first mini-app super-app for Patriot HackFest's "Life Underground" track. One Ed25519 identity, one signed event log, and one replay-derived mutual-credit wallet sit under an Alipay/WeChat/Tuya-style mini-app launcher. Thirteen mini-apps cover all 15 official problems between them, plus a built-in "upload your own mini-app and share it by QR code" capability.
No backend holds any application state. Everything a resident does is a signed event; every balance and every allocation is a deterministic replay of that event log, computed fresh in the browser every time.
New here? See DEMO.md for a plain-language summary, how it works, and a step-by-step guide to running and demoing it live.
Live demo
Try it: the deployed build lives at a Vercel preview URL that was created
with vercel deploy --temporary --yes during this build window. Temporary
preview URLs expire roughly one hour after the last deploy to them, so by the
time you read this the link below may already be dead - this was an explicit,
accepted tradeoff for the submission window, not an oversight. A permanent
vercel --prod deployment is planned separately, outside this document's
scope.
-
Preview URL (may be expired):
https://agile-citrine-45o1qv9.tmp.now -
If it's dead, redeploy it yourself in under a minute:
npm install npm run build npx vercel --prod # or: npx vercel deploy --yes for a fresh preview(Requires a free Vercel account;
vercel loginonce if you've never used the CLI before.)
Demo video
A scripted, mechanically-recorded (Playwright) walkthrough lives at
.omo/evidence/the-commons-hollow/task-60-the-commons-hollow.mp4.
It runs 32.76 seconds, well under the 180-second / 3-minute limit, and covers
the honesty-anchor chain and the Assembly partition-heal as the two
mandatory beats, plus a tour of the remaining shipped mini-apps.
What THE COMMONS is
The Hollow's resident today has no tool at all for any of this. THE COMMONS gives them one app, one login, one wallet, covering every civic function in their life: rationing, water safety, tunnel hazards, housing, group decisions in a cut network, finding separated family, a clinic visit, a body clock with no sun, growing food, a fair lottery for scarce slots, the climb back to the surface, learning a trade, and a shared sense of culture.
Problem-to-mini-app mapping
The official packet poses 15 numbered problems. THE COMMONS answers all 15 with 13 mini-apps, merging three pairs of connected problems into a single honest mechanism instead of shipping three thin, disconnected tools:
| Problem(s) | Official ask | Mini-app | Mechanism |
|---|---|---|---|
| P1, P2, P3 | Warn before power/air cuts; share power/water/food fairly; keep lower levels livable | Fair Share (ma-fairshare) |
Competitive-Equilibrium-from-Equal-Incomes (CEEI) allocator across power, water, food, and cooling; envy-free, Pareto-efficient, with a real allocation-history trend as the honest early-warning signal (no fabricated sensor) |
| P4 | Catch bad water | Water Watch (ma-waterwatch) |
CUSUM/EWMA change-point detection over corroborated resident water readings, feeding Fair Share's water number |
| P5 | Keep tunnels safe | Tunnel Safety (ma-tunnelsafety) |
Crowd-sourced hazard reports plus A* routing around closed tunnel segments |
| P6 | Find/share space | Housing (ma-housing) |
Constraint-based assignment engine (accessibility, family cohesion, medical proximity) with a fairness-debt ledger carried across cycles |
| P7, P13 | Organize without the network; prove the surface is safe | Assembly (ma-assembly) |
Yjs CRDT for offline-first proposals/rosters/votes with liquid-democracy tally, a 3-layer resilience model (local-first, WebRTC partition-and-heal, QR-sneakernet air-gapped fallback), and a signed public testimony board reusing the same event-log infrastructure as group voting |
| P8 | Reconnect families | Find Family (ma-findfamily) |
Private-set-intersection search so neither the relay nor the other party learns who searched unless there's a real match |
| P9, P10 | Track outbreak, route supplies; care without a clinic | Health Post (ma-healthpost) |
WHO-IMCI protocol-guided triage chat backed by real crowd symptom self-reports aggregated into a dispatch-facing tally |
| P11 | Life without sunlight | Light Clock (ma-lightclock) |
Circadian phase-response model from manual/sensor light exposure logs; a personal wellness tracker only, never wired to ration anything |
| P12 | Grow/share food | Farms (ma-farms) |
Growing-degree-day model plus an LP planting optimizer under a fixed grow-light power budget, feeding Fair Share's food number |
| P14 | Which option works, who's first | Fair Draw (ma-fairdraw) |
Commit-reveal lottery engine; its tie-break utility is reused by other mini-apps that need a provably unriggable draw |
| P15 | Plan the mass return | The Climb (ma-theclimb) |
Min-cost-flow scheduling plus a congestion simulation for surface-return logistics, calling Fair Draw for contested wave slots |
| (wildcard) | - | Mentor (ma-mentor) |
Skill-criticality-ranked knowledge feed with FSRS spaced-repetition scheduling, so trade knowledge survives a generation |
| (wildcard) | - | Sky (ma-sky) |
Ambient clock-schedule and shared memory wall; a culture/morale mini-app, not a utility |
Shared across every mini-app above: one identity, one wallet (mutual-credit balance card + transaction history), and one signed event log that every mini-app reads and writes through - never a mini-app-local store pretending to be independent.
Build and run
npm install
npm run dev # Vite dev server at http://localhost:5173
npm run build # tsc -b (type-check gate) && vite build -> dist/
npm run test # vitest run
npm run lint # oxlint
The app is local-first: everything except the mini-app-sharing blob store
(api/, used only by the upload/QR flow) runs entirely in the browser
against IndexedDB (Dexie). To run the blob API locally alongside the dev
server: npm run dev:api.
Authoring your own mini-app
Anyone can upload a mini-app (an HTML file plus a manifest) through the Upload mini-app in the shell, and share it to another device with a scannable install QR code. There is no sandboxing in this MVP (an explicit, accepted scope cut, not an oversight): an installed mini-app gets direct DOM mounting and the same shared SDK access any shell code has.
Manifest schema
A manifest is a JSON object with four fields, validated before the package
is ever stored (src/lib/miniappManifest.ts):
{
"name": "My Mini-App",
"icon": "📦",
"entryPoint": "index.html",
"permissions": ["ledger.read", "eventlog.read", "eventlog.write"]
}
| Field | Type | Meaning |
|---|---|---|
name |
non-empty string | display name shown on the home-grid tile |
icon |
non-empty string | emoji, data URI, or relative path within the package |
entryPoint |
non-empty string | the file inside the package to load on launch |
permissions |
array of strings | declared capabilities, each one of ledger.read, ledger.write, eventlog.read, eventlog.write, identity.read |
A manifest missing a required field, or declaring an unknown permission string, is rejected with a specific, actionable error naming the offending field - but validation checks shape and completeness only. There is no runtime permission-enforcement layer: a mini-app that passed validation gets the full shared SDK below regardless of which permissions it declared. That is a deliberate MVP cut, not a bug.
SDK surface
Once mounted, a mini-app's own script can call the shared SDK object
(src/shell/miniappSdk.ts) directly:
sdk.ledger.getBalance(accountId?) // -> Promise<number>, your current wallet balance
sdk.eventlog.append(...) // the real signed-append path, same one the shell uses
sdk.eventlog.readAll() // the real ordered read path, same one the shell uses
sdk.identity.getPublicKey() // your Ed25519 public key
eventlog.append/readAll and identity.getPublicKey are the actual shell
module functions, exposed unwrapped - not a mocked or narrowed copy.
ledger.getBalance is a convenience composition over the shell's pure
ledger-replay functions, since the ledger itself holds no state of its own.
What this does NOT do
- No hardware of any kind. Every reading in every mini-app comes from a real resident report through the UI, never a simulated sensor.
- No fabricated or simulated data standing in for reality anywhere. Light Clock stays a personal circadian tracker; it is never wired to ration a real resource.
- No generic backend "allocator kernel" plugin interface. Each mini-app's solver is hard-coded to that mini-app, on purpose - unifying them behind a shared abstraction was considered and explicitly cut as premature.
- No runtime dependency on an LLM or agent framework in the shipped app. OmO/senpi was a build tool for this session only; the deployed app calls none of it.
- No sandboxing or isolation for uploaded mini-apps. Direct DOM mount with full shared-SDK access is the MVP design, not a shortcut taken under time pressure - see "Authoring your own mini-app" above.
- No blockchain, mining, or global consensus for the wallet. Balances are Ed25519-signed events replayed deterministically; that makes forgery mathematically impossible and makes a double-spend provable the moment two replicas re-merge, but it does not make a double-spend committed during a simultaneous, total network partition real-time preventable without consensus or hardware neither of which this build has. The wallet is honestly single-device-per-identity in the shipped app; only Assembly's separate CRDT document gets real cross-device sync.
- No dark-mode theme, and no hard Lighthouse-score gate. Lighthouse is recorded for information only and never blocks a deploy.
- Nothing here claims an unbuilt mini-app as "live." All 13 mini-apps listed above are built, tested, and wired into the shell; there is no mini-app left unbuilt to disclose as roadmap. The one outstanding item from the submission checklist is a permanent (non-temporary) production deployment, planned separately, outside this document's scope (see "Live demo" above).
A note on timing
Research, problem selection, and the written plan for this build all happened before the official build window opened, which is standard hackathon practice: the official rule bans writing the submitted application's source code outside the build window, not prior planning or library selection. Every line of application code in this repository was written inside the official build window.
License
MIT - see LICENSE.