5.7 KiB
5.7 KiB
Greetings And Presence Plan (1.0.19)
Purpose
Recreate the original Jibo greeting charm with modern cloud architecture:
- person-aware greetings when someone is detected
- proactive offers tied to presence, time of day, and memory
- safe cooldown rules so proactivity feels alive, not noisy
This plan is source-anchored to Pegasus and scoped to shippable slices.
Pegasus Behavior Baseline
Primary source artifacts:
C:\Projects\jibo\pegasus\packages\hub\be-skills\greetings_manifest.jsonC:\Projects\jibo\sdk\skills\greetings\src\GreetingsSkill.tsC:\Projects\jibo\sdk\skills\greetings\src\GreetingsSM.tsC:\Projects\jibo\sdk\skills\greetings\src\states\IntentSplit.tsC:\Projects\jibo\sdk\skills\greetings\src\states\ProactiveGreetingState.tsC:\Projects\jibo\sdk\skills\greetings\src\states\ProactiveProbabilityState.tsC:\Projects\jibo\sdk\skills\greetings\src\states\ShouldDoMorningGreetingState.tsC:\Projects\jibo\sdk\skills\greetings\src\states\ShouldDoBirthdayState.tsC:\Projects\jibo\sdk\skills\greetings\src\states\ShouldDoHolidayState.tsC:\Projects\jibo\pegasus\packages\hub\src\proactive\ProactiveTransactionHandler.tsC:\Projects\jibo\pegasus\packages\hub\src\proactive\tools\ContextTools.ts
Key behaviors to port:
- explicit reactive/proactive greeting split
- identity source split:
- reactive path uses active speaker
- proactive path uses present identified persons
- hub-level proactive gating:
- block greetings when trigger source is
SURPRISE - throttle by interaction history (
GreetingsLaunchLast2Hours < 1)
- block greetings when trigger source is
- morning/birthday/holiday gates with per-user recency checks
- optional follow-up response flow after proactive greetings
Current OpenJibo Baseline
Current implementation anchor:
C:\Projects\JiboExperiments\OpenJibo\src\Jibo.Cloud\dotnet\src\Jibo.Cloud.Application\Services\JiboInteractionService.csC:\Projects\JiboExperiments\OpenJibo\src\Jibo.Cloud\dotnet\src\Jibo.Cloud.Application\Services\ProtocolToTurnContextMapper.csC:\Projects\JiboExperiments\OpenJibo\src\Jibo.Cloud\dotnet\src\Jibo.Cloud.Application\Services\WebSocketTurnFinalizationService.csC:\Projects\JiboExperiments\OpenJibo\src\Jibo.Cloud\dotnet\src\Jibo.Cloud.Application\Services\ChitchatStateMachine.csC:\Projects\JiboExperiments\OpenJibo\src\Jibo.Cloud\dotnet\src\Jibo.Cloud.Infrastructure\Persistence\InMemoryPersonalMemoryStore.cs
What we already have:
- tenant-scoped memory primitives (name, birthday, preferences, affinity)
- proactivity baseline with pending-offer follow-up handling
- state-machine style chitchat split (
ScriptedResponse,EmotionQuery,EmotionCommand,ErrorResponse) - GLSM-aware websocket lifecycle and stuck-listen recovery
Main gap:
- no first-class presence/identity perception extraction from runtime context for greeting policy decisions
Implementation Slices
Slice G1: Presence Context Extraction And Session Snapshot
Goal:
- extract presence/identity fields from websocket context payload into normalized metadata for routing
Initial fields:
- focused speaker id
- identified person ids present
- total people present
- trigger source if present
- time-of-day helper signals
Notes:
- no facial-recognition implementation is needed in cloud; cloud consumes robot perception signals
Slice G2: Greeting Intent Families And Parser Guardrails
Goal:
- add explicit greeting intent families with question/command guardrails
Initial families:
hello,hey jibo,what's upgood morning,good afternoon,good evening,good nighti'm home,i'm back- identity question (
who am i) as a future-compatible hook
Guardrails:
- avoid stealing non-greeting domains
- keep existing date/time and birthday disambiguation intact
Slice G3: Greeting State-Machine Port (OpenJibo Style)
Goal:
- add a greeting state-machine module with explicit route metadata like chitchat
Planned routes:
ReactiveGreetingProactiveGreetingMorningGreetingSpecialDayGreetingOptionalResponseErrorResponse
Output shape:
- keep stock-compatible skill payload patterns
- preserve MIM/ESML hook points for charm content
Slice G4: Proactive Gating And Cooldowns
Goal:
- port the critical Pegasus policy behavior to prevent spam
Phase-1 rules:
- skip proactive greetings when trigger source is surprise
- enforce per-tenant/person cooldown (target parity: 2-hour greeting window)
- suppress proactive launch when session is unstable (pending listen/follow-up conflict)
Slice G5: Person Queue And Memory Extensions
Goal:
- introduce lightweight person queue/history for greeting relevance
Phase-1 storage additions:
- last-seen timestamp per person key
- last-greeted timestamp per person key
- optional preferred-name alias for spoken greeting personalization
Slice G6: Rollout, Logging, And Live Validation
Goal:
- ship safely with observability and test confidence
Required coverage:
- unit tests for context extraction and intent routing
- websocket tests for presence-triggered greeting eligibility and cooldown behavior
- live captures validating:
- no stuck listening regressions
- no runaway proactive loops
- stable fallback when identity is unknown
Suggested Build Order
- G1 context extraction + diagnostics
- G2 greeting parser families + guardrails
- G3 greeting state machine (reactive first)
- G4 proactive gating + cooldowns
- G5 person queue memory extensions
- G6 live validation and polish
Definition Of Done For This Track
- presence-aware greeting behavior works with and without identified users
- proactive greeting frequency is policy-bounded and observable
- no regressions in existing
1.0.19memory/weather/proactivity flows - release docs and backlog are updated with shipped scope and next slice