Elie Habib
93eca7bbbf
fix(digest): dense-fill topicOf with -1 sentinel + surface missed indices
...
Greptile P2 on PR #3247 : `new Array(top.length)` creates a sparse array.
If a future injected clusterFn doesn't cover every input index,
topicOf[i] would be undefined, which then silently poisons the phase-1
aggregates (topicSize[undefined] / topicMax[undefined]) and degrades
the topic sort without any observable failure.
Fill with -1 so absence is unambiguous, then validate after clusterFn
runs and throw if any index is still -1. The outer try/catch captures
the error and returns {reps: top, topicCount: top.length, error}
matching the existing contract — primary order is preserved, no crash.
No behavior change today: singleLinkCluster's union-find guarantees
every index is covered. This just guards the invariant for future
clusterFn injections.
2026-04-21 08:52:49 +04:00
..
2026-04-12 15:09:54 +04:00
2026-04-21 08:52:49 +04:00
2026-04-20 19:03:47 +04:00
2026-04-20 19:07:09 +04:00
2026-02-28 17:43:56 +04:00
2026-04-16 07:58:18 +04:00
2026-04-02 08:17:32 +04:00
2026-03-23 16:10:49 +04:00
2026-04-04 15:38:02 +04:00
2026-04-11 09:39:27 +04:00
2026-03-29 11:09:26 +04:00
2026-04-13 13:00:14 +04:00
2026-04-16 10:41:15 +04:00
2026-03-28 15:03:54 +04:00
2026-03-16 08:40:14 +04:00
2026-04-16 09:24:12 +04:00
2026-03-14 21:29:21 +04:00
2026-04-20 09:36:10 +04:00
2026-03-19 00:24:47 +04:00
2026-04-14 22:11:56 +04:00
2026-04-14 22:11:56 +04:00
2026-04-20 09:36:10 +04:00
2026-03-31 07:54:23 +04:00
2026-03-28 19:51:29 +04:00
2026-04-11 08:21:08 +04:00
2026-04-16 09:25:06 +04:00
2026-03-14 21:29:21 +04:00
2026-04-20 22:37:49 +04:00
2026-03-31 13:09:21 +04:00
2026-04-17 08:12:07 +04:00
2026-04-13 20:35:16 +04:00
2026-04-04 15:38:02 +04:00
2026-03-14 21:29:21 +04:00
2026-03-12 06:50:30 +04:00
2026-03-05 10:16:43 +04:00
2026-03-19 10:31:37 +04:00
2026-03-14 21:29:21 +04:00
2026-03-23 23:59:21 +04:00
2026-02-26 20:52:44 +04:00
2026-03-15 15:57:22 +04:00
2026-03-24 18:52:02 +04:00
2026-03-15 15:57:22 +04:00
2026-03-19 02:40:05 +04:00
2026-03-17 06:35:12 +04:00
2026-03-01 11:53:20 +04:00
2026-03-01 11:53:20 +04:00
2026-03-14 21:29:21 +04:00
2026-03-28 23:59:47 +04:00
2026-04-04 15:38:02 +04:00
2026-03-01 15:59:53 +04:00
2026-04-03 23:25:08 +04:00
2026-04-08 11:21:40 +04:00
2026-04-11 17:55:39 +04:00
2026-03-14 21:29:21 +04:00
2026-03-01 11:53:20 +04:00
2026-04-17 08:35:20 +04:00
2026-04-20 09:19:47 +04:00
2026-04-18 20:27:08 +04:00
2026-04-18 20:27:08 +04:00
2026-04-10 15:34:52 +04:00
2026-04-05 09:03:34 +04:00
2026-04-05 09:03:34 +04:00
2026-03-15 15:57:22 +04:00
2026-03-23 23:59:21 +04:00
2026-03-01 11:53:20 +04:00
2026-04-03 10:27:37 +04:00
2026-04-10 15:54:30 +04:00
2026-04-15 09:16:27 +04:00
2026-04-20 22:37:49 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-18 14:40:00 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-20 15:21:43 +04:00
2026-04-20 15:21:43 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-13 08:05:59 +04:00
2026-04-16 13:41:28 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-16 09:25:06 +04:00
2026-04-14 12:29:17 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:06:24 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-21 08:35:10 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-03-27 11:48:02 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-18 14:40:00 +04:00
2026-04-07 22:24:17 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-16 09:25:06 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-01 08:53:13 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-16 10:41:15 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-16 09:25:06 +04:00
2026-04-03 10:27:37 +04:00
2026-04-15 09:16:27 +04:00
2026-04-12 21:34:38 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-03-22 19:59:42 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-06 13:58:54 +04:00
2026-04-15 09:16:27 +04:00
2026-04-16 09:25:06 +04:00
2026-03-15 15:57:22 +04:00
2026-04-15 09:16:27 +04:00
2026-03-22 19:59:42 +04:00
2026-04-20 19:03:47 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-20 15:21:43 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-12 11:46:04 +04:00
2026-04-04 23:19:33 +04:00
2026-04-15 09:16:27 +04:00
2026-04-13 09:21:13 +04:00
2026-04-16 12:48:41 +04:00
2026-04-13 13:00:58 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-03-22 19:59:42 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-04-15 09:16:27 +04:00
2026-03-17 16:12:05 +04:00
2026-04-15 09:16:27 +04:00
2026-03-14 10:23:20 +04:00
2026-04-15 09:16:27 +04:00
2026-03-19 01:57:27 +04:00
2026-04-13 21:53:21 +04:00
2026-04-20 08:40:29 +04:00
2026-02-19 07:53:15 +04:00
2026-04-17 08:12:07 +04:00
2026-04-12 10:18:42 +04:00
2026-04-12 10:22:21 +04:00
2026-03-14 21:29:21 +04:00
2026-04-02 08:55:22 +04:00
2026-03-26 13:47:22 +02:00
2026-04-14 22:11:56 +04:00