mirror of
https://github.com/bitbaum/heidi.git
synced 2026-12-05 20:47:22 +01:00
Sync: signed in, off by default. Each device stores only what it observed; the server keeps each device's records apart (progress_devices) and pages show the sum, so nothing is counted twice however often devices sync. Model: sum; history: union; streak: newest record, best of all; saved words: the newest list is adopted, so deletions stay deleted. Server-side, every value goes through the browser's own decoder and is stored normalised. Off removes this device's copy; 'delete everything synced' removes all. Certificates: issued by the server from synced progress with the same strengthOf the situation page uses, only at 'sure'. A public, noindex page per certificate shows the situation, date and what was measured; no name (one can be typed for printing and is not stored). The scope line says it is listening comprehension in one situation, not a language diploma. Migration 0004 (progress_devices, certificates); both in APP_TABLES. Privacy flows declared; the practice note now says 'unless you switch sync on'. Roadmap items move to the changelog. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
26 lines
1008 B
TypeScript
26 lines
1008 B
TypeScript
import type { LearnerModel } from "../practice/model.ts";
|
|
import { strengthOf, type SituationStrength } from "../practice/situation-strength.ts";
|
|
import { sumModels } from "./sync.ts";
|
|
|
|
/**
|
|
* Whether a learner has earned a certificate for a situation — decided on the
|
|
* server, from every device's synced record, by the same `strengthOf` the
|
|
* situation page shows. One rule, two places it is read; never two rules.
|
|
*
|
|
* ONLY AT "sure": every line Heidi can ask about holds, and most have come
|
|
* back and held again. "Steady" is real progress and says so on the page; a
|
|
* certificate is a claim made to somebody else, and it is only made where the
|
|
* page would make it in full.
|
|
*/
|
|
export function evidenceFor(
|
|
scene: string,
|
|
deviceModels: readonly LearnerModel[],
|
|
askable: ReadonlySet<number>,
|
|
): SituationStrength {
|
|
return strengthOf(scene, sumModels(deviceModels), askable);
|
|
}
|
|
|
|
export function qualifies(s: SituationStrength): boolean {
|
|
return s.askable > 0 && s.standing === "sure";
|
|
}
|