Repository navigation
fix(graph): keep each observation's best graph score - #1560
Conversation
searchByEntities and expandFromChunks deduplicated observations with a set shared across every start node, so the first path to reach an observation fixed its score. A neighbour path (about 0.4) ran before an entity's own-observation pass and kept its score, so that pass skipped observations the entity owns outright (1.0). This happens even with a single matching entity whenever a neighbour shares the observation, which is the usual result of extraction. Which score survived depended on traversal order rather than on the graph. Keep the highest score per observation instead. An upgraded entry takes the position where its winning score was found, so ties among observations the old code already scored correctly keep their order. Signed-off-by: Dmitrii Zhukov <dmitry0983@gmail.com>
|
@dmazhukov is attempting to deploy a commit to the rohitg00's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
The existing re-scoring test only covers a start node upgrading a path hit. Add a path upgraded by a better path in searchByEntities and the same case in expandFromChunks, asserting the upgraded score so that a missing upgrade fails as well as a missing reorder. Signed-off-by: Dmitrii Zhukov <dmitry0983@gmail.com>
|
Reconciled with #1559 on With #1559's early own-observation pass, the start-node fixture here no longer tests anything, so 739c01c adds a path-over-path upgrade and the same case for |
Base rewrote graph-retrieval.ts and its tests for the bounded index reader (rohitg00#1559), so both conflicted files take the base version here; the best-score fix is re-applied on top of the new retrieval path in the next commit. Signed-off-by: Dmitrii Zhukov <dmitry0983@gmail.com>
Evidence collection stopped at the first observation it saw, so an observation reachable from several start nodes or several destination nodes kept whichever score was produced first. A weak long path visited early could outrank a short strong one, and which score survived depended on start-node ordering. Scores now key on the observation id and are replaced only by a strictly higher one; a re-scored observation moves behind the entries that reached that score first, so ties stay deterministic. A start node's own observations stay at 1.0, as they were when the first-seen set pinned them. Signed-off-by: Dmitrii Zhukov <dmitry0983@gmail.com>
|
Rebuilt on top of #1559, which rewrote #1559 closed the start-node half of #1558: own observations are appended first at 1.0. The rest is still open on Index reads are unchanged: |
…ieval-best-score Signed-off-by: Dmitrii Zhukov <dmitry0983@gmail.com>
Keeps the highest graph score per observation in
searchByEntitiesandexpandFromChunksinstead of the score of whichever path reached it first. Fixes #1558.Evidence collection stopped at the first observation it saw, so an observation reachable from several start nodes kept whichever score came first: a weak long path visited early outranked a short strong one, and which score survived depended on the alphabetical order of the entity names. Recall ordering on existing stores changes where that happened.
Rebuilt on #1559. The fix lives in
appendand adds no index reads, since the evidence it compares is already memoized. Path selection inside a traversal is still Dijkstra's, a re-scored observation moves behind the entries that reached that score first, and a start node's own observations stay at 1.0.Summary by CodeRabbit