fix(explore): auto-focus the engagement spine that has event history#130
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Surfaced by running
scripts/verify-demo.shduring the spec-conformancepass: the demo failed at
present sources-filter.Root cause is the workspace auto-focus, not the backend. It picked the
first engagement
spine: trueinstance (firstWhere), which afterthe multi-scenario corpus grew (alpina/ha spines) lands on
alpina-spine — whose events are seeded
status: inbox(candidates),not
processedhistory. Solist_eventsis empty, the SOURCES filterrenders nothing (
event_pane.dart'sif (sources.isEmpty) …), and thedemo's region assertion fails. (The backend is correct — only
hoffmann-spine has assigned/processed history; verified via direct
/mcplist_eventsprobes.)New
autoFocusTargetProviderranks the engagement-spine candidates byprocessed-event count (
list_eventslength) and focuses the mostpopulated 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 analyzeclean.
scripts/verify-demo.shnow exits 0: all 11 region labels present(incl.
sources-filter), all backend/mcpprobes pass, and the fullM7 capture→inbox→
escurel-demo-agentfold loop runs (spine events6→7). Screenshot captured at
target/demo-shots/crm.png.🤖 Generated with Claude Code