Documentation

LegacyStatusSeed
in package

FinalYes

Seeds FSRS memory state for a term that has never been graded.

Every existing install has terms with a WoStatus and a WoStatusChanged but no review history, so starting them all as brand-new FSRS cards would throw away everything the user has already learned and flood the queue. Instead each status is mapped to the stability that reproduces the legacy Leitner schedule.

Seeding is lazy — a row appears in term_schedule on a term's first graded review, not via a bulk backfill. A 100k-term vocabulary therefore costs nothing at upgrade time, and terms never reviewed never occupy a row.

Table of Contents

Constants

STABILITY_BY_STATUS  : array<int, float> = [1 => 1.0, 2 => 2.0, 3 => 9.0, 4 => 27.0, 5 =>...
Days each legacy status took to become "due" under TermStatusService::SCORE_FORMULA_TODAY, i.e. where `base(status) - decay(status) * days` crosses zero.

Methods

defaultDifficulty()  : float
FSRS's initial difficulty for a "Good" first answer, clamped.
forStatus()  : MemoryState|null
Build the seed state for a term, or null if the status is not schedulable.

Constants

STABILITY_BY_STATUS

Days each legacy status took to become "due" under TermStatusService::SCORE_FORMULA_TODAY, i.e. where `base(status) - decay(status) * days` crosses zero.

private array<int, float> STABILITY_BY_STATUS = [1 => 1.0, 2 => 2.0, 3 => 9.0, 4 => 27.0, 5 => 71.0]

status 1: -7d => due immediately status 2: 6.9 - 3.50d => ~2 days status 3: 20 - 2.30d => ~9 days status 4: 46.4 - 1.75d => ~27 days status 5: 100 - 1.40d => ~71 days

Because stability is defined as the time for retrievability to fall to 0.9, and the default target retention is also 0.9, stability in days is numerically the legacy interval — so these double as seed stabilities.

Methods

defaultDifficulty()

FSRS's initial difficulty for a "Good" first answer, clamped.

public static defaultDifficulty() : float
Return values
float

forStatus()

Build the seed state for a term, or null if the status is not schedulable.

public static forStatus(int $status, DateTimeImmutable $statusChanged) : MemoryState|null

98 (ignored) and 99 (well-known) are manual flags that were never part of the review queue, so they get no scheduling state.

Parameters
$status : int

The term's WoStatus

$statusChanged : DateTimeImmutable

When it last changed (WoStatusChanged)

Return values
MemoryState|null
On this page

Search results