Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

docs: add M55 POST Enhancement plan and feature doc

Adam Eivy7c7a60459f0e
diff --git a/PLAN.md b/PLAN.md
index 5367636887..537816100c 100644
--- a/PLAN.md
+++ b/PLAN.md
@@ -77,13 +77,21 @@ pm2 logs
- [x] **M51**: Memory System PostgreSQL Upgrade - PostgreSQL + pgvector backend with HNSW vector search, tsvector full-text search, federation sync, and pg_dump backup integration
- [x] **M44 P6**: MeatSpace - Genome/Epigenetic Migration cleanup (route comments updated to `/api/meatspace/genome/`, IdentityTab genome link points to `/meatspace/genome`)
-- [x] **M53**: POST (Power On Self Test) - Daily cognitive self-test with mental math drills (P1) and LLM-powered wit & memory drills (P2). See [POST](./docs/features/post.md)
+- [x] **M53**: POST (Power On Self Test) - Daily cognitive self-test with mental math drills (P1) and LLM-powered wit & memory drills (P2).
- [x] **M44 P7**: MeatSpace - Apple Health Integration (live sync via Health Auto Export app + bulk XML import)
- [x] **M46**: Unified Search (Cmd+K) - Global search across brain, memory, history, agents, tasks, and apps
- [x] **GSD Tab**: Smart State Detection, One-Click Agent Spawn, Actionable Dashboard
### In Progress
+- [ ] **M55**: POST Enhancement — Memory builder, imagination drills, training mode, 5-min balanced sessions. See [POST](./docs/features/post.md)
+ - [ ] P1: Memory Builder engine + Elements Song — data model, CRUD routes, practice/mastery tracking, built-in Elements Song content with lyrics and element mapping
+ - [ ] P2: Memory Builder UI — MemoryItemList, MemoryPractice (learn/fill-blank/sequence/random-prompt/speed-run modes), ElementsSong periodic table visualization with mastery coloring
+ - [ ] P3: Imagination & Ideation drills — what-if, alternative-uses, story-prompt, invention-pitch, reframe; LLM generation + scoring; ImaginationDrillRunner UI
+ - [ ] P4: Training mode — per-domain train vs test toggle in session launcher, progressive difficulty, hints, immediate feedback, practice log tracking (separate from scored history)
+ - [ ] P5: 5-minute session flow — time-budgeted session that pulls one drill per enabled domain, transition UI between drills, session score as weighted domain average
+ - [ ] P6: Custom memory items — user adds songs/poems/speeches/sequences via config UI, auto-chunking, spaced repetition scheduling based on mastery
+
- [ ] **M54**: MeatSpace Life Calendar — "4000 Weeks" mortality-aware time mapping
- [x] P1-P3: Core calendar engine, Calendar tab UI, Overview integration (life grid, time stats, activity budgets, view modes, birthday highlights, hide-spent toggle, nav link)
- [x] P4: Birthdate management — birthDate canonical source moved to `meatspace/config.json` with auto-migration from `goals.json`. `GET/PUT /api/meatspace/birth-date` endpoints. AgeTab shows birthdate display + inline edit. Calendar error links to `/meatspace/age`. Identity setBirthDate syncs to both stores.
@@ -107,6 +115,25 @@ pm2 logs
## Planned Feature Details
+### M55: POST Enhancement — Training + Memory Builder + Imagination
+
+Evolves POST from a test-only system into a cognitive training platform. Covers five domains: **Math** (existing), **Memory** (new), **Wordplay** (existing), **Verbal Agility** (existing), **Imagination** (new). Sessions take ~5 minutes with balanced time budgets across domains.
+
+**Phases:**
+
+- **P1: Memory Builder Engine + Elements Song** — Memory item data model (`data/meatspace/post-memory-items.json`), CRUD routes (`GET/POST/PUT/DELETE /api/meatspace/post/memory-items`), practice submission with mastery tracking (`POST /memory-items/:id/practice`), mastery retrieval. Built-in Elements Song: Tom Lehrer lyrics parsed into lines with element name → symbol/atomic number mapping, chunked into verses.
+- **P2: Memory Builder UI** — `MemoryItemList` (browse/add items), `MemoryPractice` with 5 training modes (learn, fill-in-the-blank, sequence recall, random prompt, speed run), `ElementsSong` component with periodic table grid colored by mastery (green/yellow/red), karaoke-style progressive reveal.
+- **P3: Imagination & Ideation Drills** — 5 new LLM drill types: `what-if` (absurd hypotheticals), `alternative-uses` (divergent thinking), `story-prompt` (connect 3 random words), `invention-pitch` (solve a problem creatively), `reframe` (positive reframing). LLM generation prompts + scoring prompts. `ImaginationDrillRunner` UI with textarea input and difficulty badges.
+- **P4: Training Mode** — Per-domain train/test toggle in `PostSessionLauncher`. Train mode: progressive difficulty, hints on wrong answers, immediate feedback, no final score. Practice log in `data/meatspace/post-training-log.json` tracks practice count, streaks, time spent. Train sessions don't appear in scored POST history.
+- **P5: 5-Minute Session Flow** — Session pulls 1 drill per enabled domain with time budgets (Math ~60s, Memory ~90s, Wordplay ~60s, Verbal ~60s, Imagination ~60s). Smooth transition UI between drills with domain label and progress. Session score = weighted average across domains.
+- **P6: Custom Memory Items** — Config UI for adding songs/poems/speeches/sequences. Auto-chunking algorithm splits content into learnable segments. Spaced repetition: focus practice on lowest-mastery chunks, graduated hint removal as mastery improves.
+
+**Data:** `data/meatspace/post-memory-items.json` (content + mastery), `data/meatspace/post-training-log.json` (practice sessions), extended `post-config.json` (imagination + memory drill settings)
+
+**Routes:** Extend existing POST routes + new memory item CRUD + practice endpoints. See [POST feature doc](./docs/features/post.md).
+
+*Touches: server/services/meatspacePost.js, server/services/meatspacePostLlm.js, new server/services/meatspacePostMemory.js, server/routes/meatspace.js, server/lib/postValidation.js, client/src/components/meatspace/post/*, client/src/hooks/usePostSession.js, client/src/services/api.js*
+
### M44 P7: Apple Health Integration
Bring Apple Health data into MeatSpace via two complementary paths: live sync from the [Health Auto Export](https://apps.apple.com/us/app/health-auto-export-json-csv/id1115567069) iOS app (~$4) and bulk historical import from Apple Health XML exports.
@@ -367,6 +394,7 @@ Check for new PortOS releases on GitHub and notify the user when an update is av
- [JIRA Sprint Manager](./docs/features/jira-sprint-manager.md) - Autonomous JIRA triage and implementation
- [Memory System](./docs/features/memory-system.md) - Semantic memory with LLM classification
- [Messages Security](./docs/features/messages-security.md) - AI prompt injection threat model and defenses
+- [POST](./docs/features/post.md) - Cognitive self-test and training system
- [Prompt Manager](./docs/features/prompt-manager.md) - Customizable AI prompts
- [Soul System](./docs/features/soul-system.md) - Digital twin identity scaffold
diff --git a/docs/features/post.md b/docs/features/post.md
new file mode 100644
index 0000000000..096ac4eac6
--- /dev/null
+++ b/docs/features/post.md
@@ -0,0 +1,189 @@
+# POST (Power On Self Test)
+
+## Overview
+
+POST is a daily cognitive self-test and training system within MeatSpace. It covers five cognitive domains: **Math**, **Memory**, **Wordplay**, **Verbal Agility**, and **Imagination**. Sessions are designed to take ~5 minutes and balance testing with active training — teaching techniques and building skills, not just measuring them.
+
+## Cognitive Domains
+
+### 1. Mental Math (existing)
+- **Doubling Chain** — sequential doubling from a seed number
+- **Serial Subtraction** — countdown by a fixed subtrahend (e.g., 100 - 7 - 7 - 7...)
+- **Multiplication** — random N-digit multiplication problems
+- **Powers** — base^exponent calculations
+- **Estimation** — approximate large arithmetic within tolerance
+
+### 2. Memory (new: Memory Builder)
+Configurable memory training for songs, poems, sequences, speeches, or any ordered content.
+
+**Built-in Content:**
+- Tom Lehrer's "The Elements" — periodic table set to music, with interactive element identification
+
+**Custom Content:**
+- User adds any text/song/sequence they want to memorize
+- System breaks it into chunks and builds progressive recall exercises
+
+**Training Modes:**
+- **Learn** — progressive reveal: show content line-by-line, then chunk-by-chunk, building from small to large
+- **Fill-in-the-Blank** — show partial content with blanks to fill; difficulty increases as more words are blanked
+- **Sequence Recall** — given a starting point, continue the sequence from memory
+- **Random Prompt** — given a random line/chunk, identify what comes before and after
+- **Speed Run** — recite the full sequence as fast as possible with accuracy tracking
+
+**Spaced Repetition:**
+- Track per-chunk mastery (how often recalled correctly, average response time)
+- Focus training on weakest chunks
+- Graduated difficulty: new items start with heavy hints, mastered items tested with no hints
+
+### 3. Wordplay (existing, enhanced)
+- **Pun/Wordplay** — create puns on given topics (LLM-scored)
+- **Word Association** — free-associate with prompt words (LLM-scored)
+
+### 4. Verbal Agility (existing)
+- **Wit Comeback** — respond to scenarios with humor (LLM-scored)
+- **Verbal Fluency** — name items in a category within time limit (LLM-scored)
+- **Story Recall** — read a paragraph, answer detail questions (LLM-scored)
+
+### 5. Imagination & Ideation (new)
+Creative thinking exercises scored by AI for originality, elaboration, and feasibility.
+
+- **What If** — respond to absurd hypothetical scenarios ("What if gravity reversed for 10 minutes every Tuesday?")
+- **Alternative Uses** — list creative uses for a common object (divergent thinking classic)
+- **Story Prompt** — given 3 random words, create a micro-story connecting them
+- **Invention Pitch** — given a problem, pitch an inventive solution in 2-3 sentences
+- **Reframe** — take a negative situation and reframe it positively/humorously
+
+## Session Structure (~5 minutes)
+
+A POST session pulls one drill from each enabled domain, time-budgeted:
+
+| Domain | Drill Count | Time Budget |
+|--------|-------------|-------------|
+| Math | 1 drill (e.g., 10 multiplication problems) | ~60s |
+| Memory | 1 memory item exercise | ~90s |
+| Wordplay | 1 drill (e.g., 3 pun challenges) | ~60s |
+| Verbal | 1 drill (e.g., 1 story recall) | ~60s |
+| Imagination | 1 drill (e.g., 2 what-if prompts) | ~60s |
+
+Total: ~5.5 minutes with transitions. Users can enable/disable any domain.
+
+## Training vs Testing
+
+Each domain supports two modes:
+- **Train** — learning-focused: hints, progressive difficulty, immediate feedback, no final score
+- **Test** — performance-focused: timed, scored, saved to session history
+
+The session launcher lets users pick mode per-domain. Training sessions are tracked separately (practice count, streaks) but don't contribute to the scored POST history.
+
+## Elements Song Memory Builder
+
+### Content Structure
+The Tom Lehrer "Elements Song" is stored as structured data:
+- Full lyrics split into lines
+- Each element name mapped to its atomic number and symbol
+- Musical phrases grouped for chunked learning
+
+### Interactive Features
+- **Karaoke Mode** — lyrics scroll with timing, user fills in blanked element names
+- **Element Flash** — show atomic number or symbol, user names the element (and vice versa)
+- **Sequence Game** — "What element comes after Arsenic in the song?"
+- **Progress Map** — periodic table colored by mastery (green = solid, yellow = shaky, red = unlearned)
+- **Audio Reference** — link to the song for listening practice (user provides their own audio file)
+
+### Data Model
+```json
+{
+ "memoryItems": [
+ {
+ "id": "elements-song",
+ "title": "The Elements (Tom Lehrer)",
+ "type": "song",
+ "builtin": true,
+ "content": {
+ "lines": [
+ { "text": "There's antimony, arsenic, aluminum, selenium", "elements": ["Sb", "As", "Al", "Se"] },
+ { "text": "And hydrogen and oxygen and nitrogen and rhenium", "elements": ["H", "O", "N", "Re"] }
+ ],
+ "chunks": [
+ { "id": "verse-1", "lineRange": [0, 3], "label": "Verse 1" }
+ ]
+ },
+ "mastery": {
+ "overallPct": 45,
+ "chunks": { "verse-1": { "correct": 12, "attempts": 20, "lastPracticed": "2026-03-08" } },
+ "elements": { "Sb": { "correct": 5, "attempts": 5 }, "As": { "correct": 3, "attempts": 5 } }
+ }
+ }
+ ]
+}
+```
+
+### Custom Memory Items
+Users can add their own items via the Config page:
+```json
+{
+ "id": "user-uuid",
+ "title": "Gettysburg Address",
+ "type": "speech",
+ "builtin": false,
+ "content": {
+ "lines": [
+ { "text": "Four score and seven years ago our fathers brought forth on this continent, a new nation" },
+ { "text": "conceived in Liberty, and dedicated to the proposition that all men are created equal." }
+ ],
+ "chunks": [
+ { "id": "opening", "lineRange": [0, 1], "label": "Opening" }
+ ]
+ },
+ "mastery": {}
+}
+```
+
+## Scoring
+
+- **Math**: accuracy (80%) + speed bonus (20%), server-rescored
+- **Memory**: chunk accuracy (70%) + sequence accuracy (20%) + speed (10%)
+- **Wordplay/Verbal/Imagination**: LLM-scored on quality criteria (80%) + speed bonus (20%)
+- **Session score**: weighted average across all completed drills
+
+## Data Files
+
+- `data/meatspace/post-config.json` — drill settings, enabled modules, time limits
+- `data/meatspace/post-sessions.json` — scored test session history
+- `data/meatspace/post-memory-items.json` — memory builder content and mastery tracking
+- `data/meatspace/post-training-log.json` — practice session log (unscored training)
+
+## Routes
+
+### Existing
+- `GET/PUT /api/meatspace/post/config` — drill configuration
+- `GET/POST /api/meatspace/post/sessions` — session CRUD
+- `GET /api/meatspace/post/sessions/:id` — single session
+- `GET /api/meatspace/post/stats` — rolling averages
+- `POST /api/meatspace/post/drill` — generate math or LLM drill
+- `POST /api/meatspace/post/score-llm` — score LLM drill responses
+
+### New (M55)
+- `GET/POST/PUT/DELETE /api/meatspace/post/memory-items` — memory item CRUD
+- `POST /api/meatspace/post/memory-items/:id/practice` — submit practice result, update mastery
+- `GET /api/meatspace/post/memory-items/:id/mastery` — get mastery breakdown
+- `POST /api/meatspace/post/drill` — extended to support `imagination` and `memory` drill types
+
+## UI Components
+
+### Existing
+- `PostTab` — view router (launcher, running, results, history, config)
+- `PostSessionLauncher` — start screen with drill summary
+- `PostDrillRunner` — math drill UI with timer
+- `PostLlmDrillRunner` — LLM drill UIs (word-association, story-recall, etc.)
+- `PostSessionResults` — score breakdown and save
+- `PostHistory` — date-range analytics with charts
+- `PostDrillConfig` — per-drill settings
+
+### New (M55)
+- `MemoryBuilder` — main memory training interface
+- `MemoryItemList` — browse/add/edit memory items
+- `MemoryPractice` — interactive practice with mode selection
+- `ElementsSong` — specialized Elements Song UI with periodic table visualization
+- `MasteryMap` — visual mastery progress (periodic table for elements, progress bar for generic items)
+- `ImaginationDrillRunner` — UI for imagination/ideation drills