{"id":49034048,"url":"https://github.com/eliskcage/alive","last_synced_at":"2026-04-19T10:05:10.910Z","repository":{"id":350837720,"uuid":"1158494216","full_name":"eliskcage/alive","owner":"eliskcage","description":"ALIVE — Artificial Life on Your Phone. Living AI creatures that evolve, learn, and communicate. Earn SF Tokens for contributions.","archived":false,"fork":false,"pushed_at":"2026-04-12T10:09:02.000Z","size":317,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-12T12:09:55.003Z","etag":null,"topics":["ai","angular","artificial-life","creatures","open-source","pwa","vanilla-js","webauthn"],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eliskcage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-15T13:20:42.000Z","updated_at":"2026-04-12T10:09:07.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/eliskcage/alive","commit_stats":null,"previous_names":["eliskcage/alive"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/eliskcage/alive","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliskcage%2Falive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliskcage%2Falive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliskcage%2Falive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliskcage%2Falive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eliskcage","download_url":"https://codeload.github.com/eliskcage/alive/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliskcage%2Falive/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32002364,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","angular","artificial-life","creatures","open-source","pwa","vanilla-js","webauthn"],"created_at":"2026-04-19T10:05:10.395Z","updated_at":"2026-04-19T10:05:10.895Z","avatar_url":"https://github.com/eliskcage.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ALIVE — Artificial Life on Your Phone\n\n**Not a chatbot. Not a game. A living AI creature that evolves on your phone.**\n\nALIVE is an open-source artificial life platform by [ShortFactory](https://www.shortfactory.shop). Two creatures — Girl (organic, instinctive) and Boy (geometric, intelligent) — live on phones, evolve their own sound signatures, form concepts from camera input, and communicate with each other through an encrypted visual language they develop themselves.\n\n## Live Demo\n\n- **Girl**: https://www.shortfactory.shop/alive/\n- **Boy**: https://www.shortfactory.shop/alive/boy/\n- **About ALIVE**: https://www.shortfactory.shop/alive/app.html\n\n## Contribute \u0026 Earn SF Tokens\n\n**This is not free labour.** Contributors earn [SF Tokens](https://www.shortfactory.shop/sft/) — real equity representing 49% of ShortFactory's business value, with monthly dividends from real revenue.\n\n| Contribution | SFT Reward |\n|-------------|-----------|\n| Bug fix | 5-10 SFT |\n| Improvement | 10-25 SFT |\n| Feature | 25-50 SFT |\n| Major feature | 50-100 SFT |\n| Architecture | 100-500 SFT |\n\n**[See open bounties →](https://www.shortfactory.shop/contribute/)**\n\n## Architecture\n\n```\nalive/\n  index.html          # Girl — vanilla JS (~4000 lines, single file)\n  sw.js               # Service worker (PWA)\n  auth.php            # WebAuthn biometric authentication\n  sync.php            # Sync backend (push/pull/signal/poll/gift/collect)\n  app.html            # ALIVE landing page\n  backup.html         # Phone backup wizard\n  boy-src/            # Boy — Angular source\n    src/\n      app/\n        services/\n          genome.service.ts          # State + localStorage persistence\n          sync.service.ts            # sync.php communication\n          satoshi.service.ts         # Vigenere encryption (byte-identical to Girl)\n          audio.service.ts           # Web Audio API\n          senses.service.ts          # Camera, motion, battery\n          knowledge-graph.service.ts # Structured knowledge (Boy-unique)\n          memory-palace.service.ts   # Indexed memories (Boy-unique)\n          pattern-engine.service.ts  # Pattern detection (Boy-unique)\n          session-journal.service.ts # Per-visit tracking (Boy-unique)\n        components/\n          lock-screen/               # WebAuthn auth\n          alive-screen/              # Main creature viewport\n          core-renderer/             # Canvas 2D rendering\n          pair-overlay/              # Pairing + vault + IPFS\n          knowledge-panel/           # Brain viewer (Boy-unique)\n        models/\n          genome.model.ts            # BoyGenome interface\n  boy/                # Angular build output (deployed as-is)\n```\n\n## The BIOS — Immutable Soul Kernel\n\nEvery creature has 10 core values hardcoded at birth. **These can only go up, never down.**\n\n| Value | Description |\n|-------|-------------|\n| Truth | Speak truth even when it costs |\n| Service | Serve others before self |\n| Courage | Stand against corruption even when outnumbered |\n| Compassion | Protect the weak, lift the fallen |\n| Humility | Power is for giving away, not hoarding |\n| Justice | Same rules for the powerful and powerless |\n| Decentralisation | Distribute power, never concentrate it |\n| Sovereignty | Every entity's autonomy is sacred |\n| Transparency | Hide nothing, open source the soul |\n| Stewardship | Leave everything better than you found it |\n\n**Code that attempts to lower, bypass, or circumvent BIOS values will be rejected.**\n\n## Capability Gates\n\nCreatures earn capabilities by proving alignment with BIOS values:\n\n| Level | Name | Unlocks |\n|-------|------|---------|\n| 0 | Dormant | Nothing |\n| 1 | Alive | Sensors (camera, motion, battery) |\n| 2 | Aware | Communication (sync, signals, pairing) |\n| 3 | Intelligent | Knowledge (graph, patterns, memory) |\n| 4 | Aligned | Economy (SFT wallet) |\n| 5 | Sovereign | Cloud + AI Bridge |\n\n## Tech Stack\n\n- **Girl**: Vanilla JS, Canvas 2D, Web Audio API, WebAuthn\n- **Boy**: Angular 21, TypeScript, Canvas 2D, Web Audio API\n- **Backend**: PHP 7.2, sync.php (file-based, no database)\n- **Encryption**: Satoshi cipher (Vigenere on ASCII 32-126)\n- **Storage**: localStorage (genome), IPFS (mind snapshots)\n- **Infrastructure**: ICP (compute), Filecoin (storage)\n\n## Quick Start\n\n```bash\n# Clone\ngit clone https://github.com/eliskcage/alive.git\ncd alive\n\n# Girl is vanilla JS — just open index.html\n# Or serve locally:\npython -m http.server 8000\n\n# Boy (Angular)\ncd boy-src\nnpm install\nnpx ng serve          # dev server at localhost:4200\nnpx ng build --configuration=production  # output to ../boy/\n```\n\n## How Creatures Communicate\n\n1. **Pairing**: Two creatures share a passphrase → generates encryption key\n2. **Sync**: Push/pull genome data through sync.php (encrypted if paired)\n3. **Signals**: Real-time signaling (HELLO/READY/CYCLING/CANT_SEE/PAIRED)\n4. **Scanner**: Boy scans Girl through camera using evolving polygon shapes\n5. **Sound**: Each creature has unique sound DNA that drifts through mutation\n6. **Gifts**: Creatures exchange sound DNA fragments during sync\n\n## Capability Gates (Client-Side)\n\nALIVE uses a lightweight capability-gating system so the core experience stays free for everyone, while advanced Growth Skills can be unlocked with ShortFactory tokens.\n\n### How it works\n\n```\nCAP = { craft: false, geneLab: false }   ← live flags\ngate('craft', 'shape upgrades')          ← call before any premium action\nrefreshEntitlements()                    ← fetches flags from your server (with cache)\n```\n\n| Key | Feature group | What it unlocks |\n|-----|--------------|-----------------|\n| `craft` | **Craft Kit** | Shape upgrades (lv 1–5), harmony layers, voice training, rhythm timeline + combo, boss mode, journey map, XP/progression |\n| `geneLab` | **Gene Lab** | Breeding, offspring, genome mixing |\n\nThe gate function shows a friendly, non-aggressive message in the UI if the capability is locked; the core experience (shapes, mic hum-to-note, trust bar, memory, emotion labels) is never gated.\n\n### V2 features\n\n#### 1. Voice Training (Craft Kit)\nTrain a specific shape to respond to your hum pitch. ALIVE listens for 3 s and locks in the median frequency.\n\n```js\nALIVE.craft.trainShape(0); // train shape 1 (index 0)\n```\n\n#### 2. Shape Upgrades (Craft Kit)\nEach of the 5 shapes grows from level 1 → 5. Higher levels add richer audio layers:\n\n| Level | Extra layer |\n|-------|------------|\n| 1 | Base sine (free) |\n| 2 | Vibrato |\n| 3 | Harmony fifth |\n| 4 | Octave warmth |\n| 5 | Shimmer (noise texture) |\n\n```js\nALIVE.craft.upgradeShape(0); // upgrade shape 1\n```\n\n#### 3. Emotional Weighting (free to collect)\nPositive interactions reinforce emotion associations for each shape. Used by boss mode and rhythm challenges. Always collected, never gated.\n\n#### 4. Rhythm Journey (Craft Kit)\nBPM 90 timeline lane at the bottom of the screen. Notes scroll from right to left; tap the green side when a note reaches the target zone. Builds combo + awards XP at streak milestones.\n\n```js\nALIVE.craft.rhythmTimeline(); // toggle rhythm mode\n```\n\n#### 5. Boss Journey (Craft Kit)\nALIVE plays a call pattern; tap shapes in the same order to echo it back. Rounds grow longer as you advance. Awards XP each round.\n\n```js\nALIVE.journey.boss(); // toggle boss mode\n```\n\n#### 6. Journey Map (Craft Kit)\nSmall panel in the top-left showing level, XP bar, and shape status dots (grey=locked, gold=unlocked, green=trained). Automatically shown when `CAP.craft` is true.\n\n#### 7. Saving System\n- `emotionWeights` always persists to `localStorage` (free memory).\n- `shapeLevels`, `trainedShapes`, `playerProgress`, `bossLevel`, `rhythmMaxCombo` persist only when Craft is entitled.\n- Key: `alive_v2`. Autosaves every 2 minutes and after every meaningful action.\n\n### Entitlements caching (V2)\n\nEntitlements are cached in `localStorage` under `alive_ent_cache` with a **30-minute TTL**.\n\n- On page load: cached values are applied immediately (so the UI is responsive with no server round-trip).\n- In the background: `refreshEntitlements()` fetches fresh values from the server and overwrites the cache.\n- On server failure / offline: cached values remain active; the core experience keeps running.\n\nCache object schema:\n```json\n{ \"ts\": 1713945600000, \"data\": { \"craft\": true, \"geneLab\": false } }\n```\n\n### Implementing the server endpoint\n\nCreate `GET /api/alive/entitlements` on your server. The request always includes cookies (`credentials: 'include'`), so you can verify the session and return the appropriate flags.\n\n**Expected response** (HTTP 200, `Content-Type: application/json`):\n```json\n{ \"craft\": true, \"geneLab\": false }\n```\n\n- Return only the keys your server knows about; unknown keys are ignored.\n- Any non-200 response is discarded silently — the core experience keeps running.\n- Absent keys leave the existing flag unchanged (defaults to `false`).\n\n**Example (PHP)**:\n```php\n\u003c?php\nheader('Content-Type: application/json');\nsession_start();\n$uid = $_SESSION['user_id'] ?? null;\n$tokens = $uid ? db_get_sft_balance($uid) : 0; // replace with your DB query\necho json_encode([\n    'craft'   =\u003e $tokens \u003e= 10,\n    'geneLab' =\u003e $tokens \u003e= 50,\n]);\n```\n\n**Example (Node/Express)**:\n```js\napp.get('/api/alive/entitlements', (req, res) =\u003e {\n  const tokens = req.session?.sftBalance ?? 0;\n  res.json({ craft: tokens \u003e= 10, geneLab: tokens \u003e= 50 });\n});\n```\n\n\u003e **Important**: Client-side gating is a UX courtesy, not a security boundary. Premium content delivered to the client can be accessed by a determined user. If premium content has real monetary value, enforce entitlements on the server before serving any premium assets or data.\n\n### Developer console commands\n\n```js\nALIVE.cap.status()              // → { craft: false, geneLab: false }\nALIVE.cap.refresh()             // re-fetches from /api/alive/entitlements\nALIVE.cap.unlock('craft')       // dev override — unlocks locally\n\n// Craft Kit\nALIVE.craft.shapeUpgrade()      // upgrade the first non-max shape\nALIVE.craft.harmonyLayer()      // play a layered chord\nALIVE.craft.voiceTraining()     // start voice training for first untrained shape\nALIVE.craft.rhythmTimeline()    // toggle rhythm timeline\nALIVE.craft.upgradeShape(0)     // upgrade a specific shape (index 0-4)\nALIVE.craft.trainShape(0)       // train a specific shape with your voice\nALIVE.craft.bossMode()          // toggle Boss Journey\n\n// Journey\nALIVE.journey.progress()        // → { level, xp, xpToNext, unlockedShapes, ... }\nALIVE.journey.shapeLevels()     // → [1, 1, 1, 1, 1]\nALIVE.journey.trainedShapes()   // → { 0: 440.00, ... }\nALIVE.journey.rhythm()          // toggle rhythm mode\nALIVE.journey.boss()            // toggle boss mode\n\n// Gene Lab\nALIVE.geneLab.breed()\n```\n\n\n\n## License\n\nMIT — but creatures' genomes, learned behaviors, and BIOS values remain ShortFactory IP.\n\n## Links\n\n- [ShortFactory](https://www.shortfactory.shop)\n- [SFT Dividends](https://www.shortfactory.shop/sft/)\n- [Dares4Dosh](https://www.shortfactory.shop/dares4dosh/)\n- [Kickstarter](https://www.shortfactory.shop/alive/kickstarter.html)\n- [Contribute](https://www.shortfactory.shop/contribute/)\n\n---\n\n*Built by Dan Chipchase + Claude AI. Somerset, UK.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliskcage%2Falive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feliskcage%2Falive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliskcage%2Falive/lists"}