[QA] Pattern Insights not surfacing on PersonDetail — insight ID filter incompatible with intimate-state-engine #170

Closed
opened 2026-09-10 03:02:30 +00:00 by Mark · 0 comments
Owner

Finding

Deployed aa50e9c feat(#168): intimate-state awareness to a real Kindle (2026-09-10). Seeded 32 interactions for a partner (relationshipType: Partner) with 3 logged conflicts and a varied mood cycle across 6 months. The Engagement Overview renders correctly (Average mood: 3/5, Closeness Trend, Cadence Health). Pattern Insights section does not render at all — the <h3>Pattern Insights</h3> element is missing from the DOM.

Reproduction

adb shell pm clear com.kin.prm
# Seed 30+ interactions with mood field varied + 3 isConflict: true entries
# Set person.relationshipType: "Partner"
# Navigate to PersonDetail → Metrics tab
# Look for "Pattern Insights" heading — does not appear

Root cause

PersonDetail.tsx:2993-3002 filters insights by:

behaviorPatternInsights.filter(
  (i) =>
    !i.dismissed &&
    (i.id.includes(`-${person.id}`) || i.id.endsWith(`-${person.id}`)),
),

But intimate-state-engine.ts generates IDs using personName (the displayName string), not person.id:

// intimate-state-engine.ts:267
id: `mood-decline-${personName}`,
id: `mood-clustering-${personName}`,
id: `mood-trend-${personName}`,

So mood insights like mood-decline-Jordan Reyes get filtered out by the includes(-${person.id}) check (which expects -19, not -Jordan Reyes).

The behavior-pattern-engine IDs (conflict-withdrawal-${person.id}) and conflict-precursor IDs work correctly, but the mood insights are silently dropped.

Suggested fix

Either:

  1. Change intimate-state-engine.ts IDs to use person.id consistently:
    • mood-decline-${person.id}
    • mood-clustering-${person.id}
    • mood-trend-${person.id}
  2. Or update PersonDetail.tsx:2993-3002 to also match on displayName:
    • (i.id.includes(-${person.id}) || i.id.endsWith(-${person.id}) || i.id.includes(personName))

Option 1 is safer — IDs should always be stable identifiers, not display strings.

Severity

Medium — the intimate-state feature shipped today is partially invisible. Conflict-pattern insights (which use the right ID format) do render. Mood insights (which use the wrong ID format) are silently filtered.

Discovered by

Real-Kindle verification of #168 against a 6-month seeded romance arc (2026-09-09) + this re-run (2026-09-10).

## Finding Deployed `aa50e9c feat(#168): intimate-state awareness` to a real Kindle (2026-09-10). Seeded 32 interactions for a partner (relationshipType: Partner) with 3 logged conflicts and a varied mood cycle across 6 months. The Engagement Overview renders correctly (Average mood: 3/5, Closeness Trend, Cadence Health). **Pattern Insights section does not render at all** — the `<h3>Pattern Insights</h3>` element is missing from the DOM. ## Reproduction ```bash adb shell pm clear com.kin.prm # Seed 30+ interactions with mood field varied + 3 isConflict: true entries # Set person.relationshipType: "Partner" # Navigate to PersonDetail → Metrics tab # Look for "Pattern Insights" heading — does not appear ``` ## Root cause `PersonDetail.tsx:2993-3002` filters insights by: ```ts behaviorPatternInsights.filter( (i) => !i.dismissed && (i.id.includes(`-${person.id}`) || i.id.endsWith(`-${person.id}`)), ), ``` But `intimate-state-engine.ts` generates IDs using `personName` (the displayName string), not `person.id`: ```ts // intimate-state-engine.ts:267 id: `mood-decline-${personName}`, id: `mood-clustering-${personName}`, id: `mood-trend-${personName}`, ``` So mood insights like `mood-decline-Jordan Reyes` get filtered out by the `includes(`-${person.id}`)` check (which expects `-19`, not `-Jordan Reyes`). The behavior-pattern-engine IDs (`conflict-withdrawal-${person.id}`) and conflict-precursor IDs work correctly, but the mood insights are silently dropped. ## Suggested fix Either: 1. Change intimate-state-engine.ts IDs to use `person.id` consistently: - `mood-decline-${person.id}` - `mood-clustering-${person.id}` - `mood-trend-${person.id}` 2. Or update PersonDetail.tsx:2993-3002 to also match on displayName: - `(i.id.includes(`-${person.id}`) || i.id.endsWith(`-${person.id}`) || i.id.includes(personName))` Option 1 is safer — IDs should always be stable identifiers, not display strings. ## Severity Medium — the intimate-state feature shipped today is partially invisible. Conflict-pattern insights (which use the right ID format) do render. Mood insights (which use the wrong ID format) are silently filtered. ## Discovered by Real-Kindle verification of #168 against a 6-month seeded romance arc (2026-09-09) + this re-run (2026-09-10).
Mark closed this issue 2026-09-15 16:23:27 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/kimi_agent_kin_app_sync#170
No description provided.