2026 03 13 S216 Vitto Jarvis Wiring Design

Documentation for Plans

S216: Vitto Jarvis Wiring — Close Every Open Loop

Summary

Vitto has 21+ implementation plans and massive infrastructure, but the connections between systems are loose. The same issues recur across sessions because features get designed but not wired end-to-end. This session closes every verified gap with surgical, small changes (~400 lines across 9 existing files + 1 new helper).

Goal: Transform Vitto from "impressive parts, loose connections" into a fully wired Jarvis-like super-agent where every subsystem feeds into every other subsystem.

Non-goal: No new features, no new architecture, no new services. Only wiring what already exists.


Gap Inventory (Code-Verified)

Each gap was verified by reading the exact source line. No assumptions.

Gap 1: Episodic Memory Gate Excludes Channel Messages

Gap 2: Skill Composition is Stubbed

Gap 3: Skill Extraction Never Notifies Training

Gap 4: Duplicate Outcome Feedback

Gap 5: Channel Session History Ignores Channel Type

Gap 6: Space Brief Thin for New Spaces

Gap 7: Daily Digest is Plain Text

Gap 8: Alert Acknowledgment Handler Missing

Gap 9: Voice Note Delivery Stubbed

Gap 10: Whisper Voice-In (Not Started — DEFERRED)


Architecture

Principle: Minimal Wiring, Maximum Impact

Every fix targets an existing file. No new services except one small helper for voice note upload. The total diff is estimated at ~400 lines across 9 files.

Fix Map

Gap File(s) to Modify Lines Changed Dependencies
1: Episodic memory gate outcome-feedback.service.ts ~12 None
2: Skill composition skill-composition.service.ts ~30 ToolRegistryService
3: Skill extraction notify skill-extraction.service.ts ~3 TrainingPluginRegistryService
4: Duplicate outcome vitto-engine.service.ts -8 (delete) None
5: Channel session filter channel-prompt-builder.service.ts, memory-persistence.service.ts ~25 Session schema
6: Space brief bootstrap space-intelligence.service.ts ~25 Space model
7: Rich daily digest daily-digest.service.ts ~40 RichMessageComposerService, ChannelGatewayService
8: Alert ack handler channel-processing.service.ts ~30 ProactiveMonitorService
9: Voice note delivery channel-processing.service.ts + new voice-note-upload.helper.ts ~40 R2/S3 SDK

Data Flow After Wiring

User Message (WhatsApp/Slack/Web)
  → RequestClassifier (routes to fast/balanced/powerful)
  → ContextAssembly (now includes: space brief [Gap 6], channel-filtered history [Gap 5])
  → AgentLoop (tools + LLM iterations)
  → Task Completion
    → MindService.recordExecution() [single path, Gap 4 fixed]
      → OutcomeFeedback (now includes channel messages, Gap 1 fixed)
        → Creates episodic memory
      → TrainingPluginRegistry.notifyTaskCompleted()
    → SkillExtraction (if pattern detected)
      → TrainingPluginRegistry.notifySkillExtracted() [Gap 3 fixed]
      → SkillComposition (now actually executes, Gap 2 fixed)
  → Response
    → RichMessageComposer (picks card/quick_reply/text)
    → ChannelAdapter (WhatsApp/Slack/Web)
    → Voice note delivery (if short + TTS enabled, Gap 9 fixed)
  → Proactive Alerts
    → Daily Digest (now rich cards, Gap 7 fixed)
    → Alert buttons → Acknowledge handler (Gap 8 fixed)

What This Does NOT Cover


Testing Strategy

Each gap fix gets a focused unit test:

Gap Test Approach
1 Mock task with channel-message type + tool calls → verify episode created
2 Mock tool registry → verify executeComposite calls tools in sequence
3 Mock training registry → verify notifySkillExtracted called after createSkill
4 Verify only ONE outcome call per task completion (no duplicate)
5 Mock sessions with channel field → verify filtering works
6 Mock space with no brief but has name/modules → verify bootstrap brief generated
7 Verify digest returns RichMessage with buttons for WhatsApp
8 Mock button payload → verify resolveAlert called
9 Mock R2 upload → verify audio sent via channelGateway

No E2E tests — these are all internal wiring fixes testable with unit mocks.


Risk Assessment

Risk Mitigation
Episodic memory bloat from channel messages Quality gate: only substantive conversations (tool calls OR long output)
Skill composition infinite loop Max 10 nodes per composite, 30s timeout per node
Voice note R2 upload failure Fire-and-forget with existing error swallowing pattern
Rich digest breaks non-WhatsApp channels Fallback text always present in RichMessage
Alert ack race condition Idempotent resolveAlert — multiple acks are safe

Success Criteria

After S216:

  1. Channel conversations appear in episodic memory (verifiable via /vitto/introspection)
  2. Extracted skills trigger training plugins (verifiable via training logs)
  3. Only ONE outcome per task in learning pipeline (verifiable via ai-agents DB query)
  4. WhatsApp users see interactive digest cards with buttons
  5. Alert "Acknowledge" buttons work end-to-end
  6. Voice notes are delivered (when TTS is enabled)
  7. New spaces get a bootstrap brief in Vitto's context
  8. Channel history is filtered by channel type