Prompts : gabarits dans docs/prompts/ et remplissage par le domaine
Cinq gabarits sous CC BY-SA 4.0 (coup, videau, bilan, concept, exercices), remplis par des fonctions pures de domain/prompts/ avec la position lue par le moteur (identifiants, lien public, diagramme) et ses chiffres, écrits comme à l'écran (domain/analysis/numbers.ts, partagé avec la feuille du maître, le bilan et l'analyse). Testés sur de vraies analyses : aucun repère vide ni inconnu, mêmes chiffres que l'écran. Fiche du glossaire « Prompt ». Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f3f977bf66
commit
4f0611c24c
@@ -48,8 +48,6 @@ export const CUBE_GLOSSARY: Readonly<Record<CubeAction, { file: string; term: st
|
||||
pass: { file: "passer", term: "Passer" },
|
||||
};
|
||||
|
||||
/** Un nombre à la française, signé, à trois décimales : « −0,123 ». */
|
||||
export function formatEquity(value: number): string {
|
||||
const text = Math.abs(value).toFixed(3).replace(".", ",");
|
||||
return value < -0.0005 ? `−${text}` : value > 0.0005 ? `+${text}` : text;
|
||||
}
|
||||
/** Un nombre à la française, signé, à trois décimales : « −0,123 » ; la
|
||||
* même écriture que les prompts (domain/analysis/numbers.ts). */
|
||||
export { formatEquity } from "../domain/analysis/numbers.js";
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
// Copyright (C) 2026 les auteurs d'Ustagammon.
|
||||
// Licence : GPLv3 ou ultérieure (voir LICENSE).
|
||||
|
||||
import { rankingRows } from "../domain/analysis/numbers.js";
|
||||
import { type MasterPhrases, masterWords } from "../domain/analysis/phrases.js";
|
||||
import {
|
||||
type Advice,
|
||||
@@ -276,18 +277,8 @@ export function createAdviceView(options: AdviceViewOptions): AdviceView {
|
||||
if (advice.kind === "move") {
|
||||
// Les écarts du classement se lisent par rapport à son premier
|
||||
// coup ; votre coup, s'il n'y figure pas, avec l'écart de
|
||||
// l'analyse du coup joué.
|
||||
const first = advice.ranking[0]?.equity ?? advice.best.equity;
|
||||
const listed = advice.ranking.map((move, i) => ({
|
||||
move,
|
||||
rank: i + 1,
|
||||
loss: move.equity - first,
|
||||
}));
|
||||
if (!advice.ranking.some((m) => m.notation === advice.played.notation)) {
|
||||
listed.push({ move: advice.played, rank: advice.rank, loss: advice.equityLoss });
|
||||
}
|
||||
for (const { move, rank, loss } of listed) {
|
||||
const mine = move.notation === advice.played.notation;
|
||||
// l'analyse du coup joué (les mêmes lignes que le prompt).
|
||||
for (const { move, rank, loss, played: mine } of rankingRows(advice)) {
|
||||
row(
|
||||
[
|
||||
String(rank),
|
||||
|
||||
@@ -10,16 +10,12 @@ import type { Roll } from "../domain/game/roll.js";
|
||||
|
||||
const plural = (n: number, one: string, many: string) => (n > 1 ? many : one);
|
||||
|
||||
/** « 41 % ». */
|
||||
export function percent(chance: number): string {
|
||||
return `${Math.round(chance * 100)} %`;
|
||||
}
|
||||
|
||||
/** Un nombre à la française, signé, à trois décimales : « +0,021 ». */
|
||||
export function signed(value: number): string {
|
||||
const text = Math.abs(value).toFixed(3).replace(".", ",");
|
||||
return value < -0.0005 ? `−${text}` : value > 0.0005 ? `+${text}` : text;
|
||||
}
|
||||
/** « 41 % » et « +0,021 » : la même écriture que les prompts
|
||||
* (domain/analysis/numbers.ts). */
|
||||
export {
|
||||
formatEquity as signed,
|
||||
formatPercent as percent,
|
||||
} from "../domain/analysis/numbers.js";
|
||||
|
||||
export const REVIEW_TEXTS = {
|
||||
// Bilan
|
||||
|
||||
Reference in New Issue
Block a user