Decide: does --cross-project let global learnings outrank local ones?
Genuine behavioral decision, not a bug to auto-fix.
bin/idstack-learnings-search:70 slices matches[-limit:] while sources are ordered local-then-global. Under --cross-project, that means global entries win when the limit truncates — which contradicts the comment directly above at :69 claiming local takes precedence.
One of the two is wrong. Either:
- the comment is right and the slice should be
matches[:limit](local wins), or - the behavior is right and the comment should go.
Leaning toward local-wins: a project-specific learning is more likely to be the relevant one, and that's what the comment says the author intended. But it's your call — this changes what designers see.
Fixed in 5127d8b (local wins). Under --cross-project the sources are now ordered global-first, local-last, so matches[-limit:] keeps local entries and the comment matches the code. The logic lives in bin/idstack-learnings since 0606b11. Regression test in test/integration-test.sh.