Skip to content

fix(explore): auto-focus the engagement spine that has event history#130

Merged
jrosskopf merged 1 commit into
mainfrom
explore/auto-focus-populated-spine
May 31, 2026
Merged

fix(explore): auto-focus the engagement spine that has event history#130
jrosskopf merged 1 commit into
mainfrom
explore/auto-focus-populated-spine

Conversation

@jrosskopf
Copy link
Copy Markdown
Contributor

Summary

Surfaced by running scripts/verify-demo.sh during the spec-conformance
pass: the demo failed at present sources-filter.

Root cause is the workspace auto-focus, not the backend. It picked the
first engagement spine: true instance (firstWhere), which after
the multi-scenario corpus grew (alpina/ha spines) lands on
alpina-spine — whose events are seeded status: inbox (candidates),
not processed history. So list_events is empty, the SOURCES filter
renders nothing (event_pane.dart's if (sources.isEmpty) …), and the
demo's region assertion fails. (The backend is correct — only
hoffmann-spine has assigned/processed history; verified via direct
/mcp list_events probes.)

New autoFocusTargetProvider ranks the engagement-spine candidates by
processed-event count (list_events length) and focuses the most
populated one (hoffmann-spine: 6 events), falling back to the first
spine, then the first instance — deterministic regardless of instance
ordering.

Test plan

  • flutter test — all 94 explore widget tests pass; flutter analyze
    clean.
  • scripts/verify-demo.sh now exits 0: all 11 region labels present
    (incl. sources-filter), all backend /mcp probes pass, and the full
    M7 capture→inbox→escurel-demo-agent fold loop runs (spine events
    6→7). Screenshot captured at target/demo-shots/crm.png.

🤖 Generated with Claude Code

The workspace auto-focus picked the first engagement `spine: true`
instance (`firstWhere`), which after the multi-scenario corpus
expansion lands on alpina-spine — whose events are inbox candidates
(status: inbox), not processed history. So list_events is empty, the
SOURCES filter renders nothing, and verify-demo.sh fails at
`present sources-filter`.

New `autoFocusTargetProvider` ranks the engagement-spine instances by
processed-event count (list_events length) and focuses the most
populated one (hoffmann-spine: 6 processed events), falling back to the
first spine, then the first instance. Deterministic regardless of
instance ordering.

Test plan:
- flutter test (94 widget tests) green; flutter analyze clean.
- scripts/verify-demo.sh now exits 0: all 11 region labels present
  (incl. sources-filter), all /mcp probes pass, and the full M7
  capture→inbox→agent-fold loop runs (spine events 6→7).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jrosskopf jrosskopf merged commit ba799c0 into main May 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant