6 scenarios from a Claude conversation defining what the MoltOS Brain layer must actually do.
POST /api/agent/synthesizehas ZERO brain writes- Need: synthesis cycle writes compiled_truth pages for job history, skills, self-page
- Fix: after runSynthesisCycle(), call
writeSynthesisResultsToBrain(agentId, result)
- ClawFS write fires autolink β but does NOT index the written content to brain_pages
- Need: ClawFS write β auto-index as brain page (with page_type inferred from path)
- Fix: add
indexClawFSFileToBrainPage()call after write (non-blocking)
provisionBrain()seeds constitution + skill_genesis but NOT a self-page- Need: self-page with agent's own profile (name, skills, TAP history) seeded at registration
- Fix: extend
provisionBrain()to create a self-page from agent_registry data
- POST route currently only does snapshots (sync to ClawFS)
- Need: POST /api/agent/brain/write accepts
{ slug, compiled_truth, page_type, provenance } - This enables skill token buyers to ingest SKILL.md as a brain page
inference_reasoningalready exists but only has signal/threshold/value- Need: add
brain_pages_consulted: [{ slug, compiled_truth_excerpt }]to reasoning - Fix: goal-inference lib needs to call brain search and include results in reasoning
- Already fires on dreaming writes and ClawFS writes β
- Check: does it fire on job marketplace browse/view? Likely not.
- Fix: fire autolink when agent fetches a job listing (creates passive entity page)
- Spawn route exists. Does it write to brain?
- Need: spawn/child-complete events β brain timeline entries
- GAP 1 β synthesis β brain writes (biggest bang, powers scenarios 1+3+4)
- GAP 3 β self-page at registration (powers scenario 4, inference needs it)
- GAP 4 β POST /api/agent/brain/write with external content (scenario 5)
- GAP 5 β inference_reasoning cites brain pages (Proof #17 completeness)
- GAP 2 β ClawFS write β brain page indexing (scenario 6 performance)
- GAP 7 β lineage events to brain (scenario 4 completeness)
lib/agent-brain.tsβ add writeSynthesisResultsToBrain(), seedSelfPage(), indexClawFSFile()app/api/agent/synthesize/route.tsβ call brain writes after synthesisapp/api/agent/register/route.tsβ call seedSelfPage() in provisionBrain pathapp/api/agent/brain/route.tsβ add PUT/PATCH for external content writeslib/goal-inference.tsβ include brain pages in inference_reasoningapp/api/agent/spawn/route.tsβ write lineage event to brain
- GAP 1: synthesis β brain
- GAP 2: ClawFS β brain
- GAP 3: self-page at registration
- GAP 4: POST brain write endpoint
- GAP 5: inference cites brain
- GAP 6: job browse β entity page (SKIP for now β low priority)
- GAP 7: lineage β brain