idstack icon indicating copy to clipboard operation
idstack copied to clipboard

Decide: does --cross-project let global learnings outrank local ones?

Open savvides opened this issue 3 months ago • 1 comments

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.

savvides avatar Aug 06 '26 00:08 savvides

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.

savvides avatar Nov 01 '26 18:11 savvides