グカネータ公開 (#361) (#368)

Reviewed-on: #368
Co-authored-by: miteruzo <miteruzo@naver.com>
Co-committed-by: miteruzo <miteruzo@naver.com>
このコミットはPull リクエスト #368 でマージされました.
このコミットが含まれているのは:
2026-06-14 05:33:39 +09:00
committed by みてるぞ
コミット 7ab46f907f
23個のファイルの変更3573行の追加466行の削除
+12 -2
ファイルの表示
@@ -100,7 +100,7 @@ export const allConcreteAnswerOptionsExhausted = (
}
const nextRecoveryBatchSize = (recoveryStepCount: number): number =>
const nextRecoveryTargetSize = (recoveryStepCount: number): number =>
6 * (2 ** recoveryStepCount)
@@ -125,6 +125,16 @@ export const recoverCandidatePosts = ({
recoveryStepCount: number
} | null => {
const recovered = new Map (recoveredCandidatePosts)
const targetSize = nextRecoveryTargetSize (recoveryStepCount)
const countedPostIds = new Set ([
...eligiblePostIds,
...recovered.keys ()])
const addCount = targetSize - countedPostIds.size
if (addCount <= 0)
return {
recoveredCandidatePosts: recovered,
recoveryStepCount: recoveryStepCount + 1 }
const candidates = posts
.filter (post =>
!(rejectedPostIds.has (post.id))
@@ -133,7 +143,7 @@ export const recoverCandidatePosts = ({
.sort ((a, b) =>
(scores.get (b.id) ?? Number.NEGATIVE_INFINITY)
- (scores.get (a.id) ?? Number.NEGATIVE_INFINITY))
.slice (0, nextRecoveryBatchSize (recoveryStepCount))
.slice (0, addCount)
if (candidates.length === 0)
return null