La pantalla era una sola columna —radio, después podcasts, después listas— y tres
listas de veinte filas es una pantalla por la que se baja buscando lo que ya sabías
que querías. Ahora pregunta primero: **Radio | Podcasts | Listas**, una lista a la
vez, **diez filas** y un **"Mostrar más"** que dice cuántas esconde. Nada queda fuera
de alcance y nada más está en pantalla mientras decidís: el subtítulo también dice qué
estás mirando en vez de hablar siempre de listas.
El **buscador** busca lo que tengas abierto y en el origen, no en la página: `jazz`
le pregunta al directorio de emisoras y `crimen` al de podcasts de Apple —filtrado,
como siempre, a español, y pasando por **la misma** función de filtro que una
categoría, porque un segundo camino más barato al catálogo es como se pierde una
regla—. Con menos de dos letras no se busca ni se pide nada: una letra coincide con
todo y sería una petición por tecla para una respuesta inservible.
La búsqueda de emisoras **ordena por lo que se buscó**: el directorio coincide con
subcadenas en cualquier parte, así que *techno* devolvía "# TOP 100 CLUB CHARTS -
DANCE & DJ MIX RADIO" —real, con "techno" entre sus etiquetas— por delante de toda
emisora llamada Techno Algo. El nombre pesa antes que la popularidad y a igual peso
gana el nombre más corto; los canales de SomaFM y los mixes de Paradise que coinciden
van primero, porque no tienen publicidad y su stream ya se sabe que funciona. La
búsqueda del directorio va con `is_https=true`, cacheada por consulta.
`lib/paging.js` es puro y tiene test porque tiene un borde fácil de equivocar en un
componente: una lista que se encoge —una búsqueda nueva, una emisora desmarcada— no
puede dejar el tamaño de página pasado del final, que se ve como "Mostrar más" que no
hace nada.
Verificado contra los directorios reales: `radio?q=jazz` → Sonic Universe (SomaFM) y
después Jazz 24; `radio?q=miami` → Miami Beach Radio, 105 Miami; `podcasts?q=crimen`
→ 20 programas en español (es, es-ar) y `q=entrenamiento en casa` → 3; `?q=j` no
busca. `relevance` y `rankStations` se comprobaron por mutación: sacar el orden hace
fallar el test que lo mira de punta a punta.
Música tiene una sección **Podcasts**: programas por categoría —Salud y fitness,
Deporte, Comedia, Noticias, Historia, Crímenes reales, Ciencia, Tecnología,
Sociedad y cultura, Negocios, Ficción, Educación, Música, Ocio— que suenan mientras
entrenás y siguen donde los dejaste. Sin dependencias nuevas y sin clave de API: el
directorio de Apple es público.
**En español se comprueba, no se supone.** La tienda dice dónde se *vende* un
podcast, no en qué idioma está —en el ranking español de comedia hay uno en catalán
y en el argentino uno en inglés—, así que se lee el `<language>` del feed de cada
programa (los primeros 64 KB, con una petición `Range`: el idioma está en las
primeras líneas) y se descarta lo que no sea español. Un feed sin etiqueta se queda:
feeds genuinamente españoles la omiten, y tirarlos por una omisión sería sacar
podcasts buenos de la lista. La respuesta cuenta cuántos quedaron afuera y por qué
(`skipped`), así que una lista corta nunca es un misterio, y abrir un programa en
otro idioma se contesta con `spanish:false` en vez de con una lista vacía.
Es la otra mitad de la radio y es lo contrario en todo lo que le importa al
reproductor: un podcast es un **archivo** —tiene principio, final y un minuto en el
que ibas—. Por eso hay un módulo de reglas puras (`lib/podcast-view.js`: dónde
retomar, qué cuenta como escuchado, cuál sigue, cuántas posiciones se guardan) y
por eso `lib/radio-player.js` pasa a ser `lib/player.js`: **un solo elemento de
audio** para las dos cosas, que es lo que impide que una emisora y un episodio suenen
a la vez. La barra crece línea de progreso, −15 s, +30 s, siguiente episodio y reloj;
la posición se guarda por perfil (con tope de 200, lo más nuevo primero) en pausa, al
parar, al terminar y cuando la app se va al fondo, porque con la pantalla bloqueada
iOS suspende los temporizadores y un guardado sólo desde el tick perdería lo
escuchado con el teléfono guardado. Media Session muestra episodio, programa y
progreso en la pantalla bloqueada.
Nada se descarga y nada pasa por el servidor: el episodio llega como la URL del
`enclosure` y el audio va de quien lo publica al teléfono. Acá no hay lista blanca
posible —un feed vive en cualquier host—, así que la puerta es **https, host real y
nunca una dirección privada**, comprobada en la URL y en dónde terminó el pedido, con
el cuerpo leído a tope y la conexión cortada al llegar: este contenedor vive adentro
de una casa.
Verificado con datos reales: 20 programas en español por categoría (idiomas es, es-ES,
es-mx), un feed de 40 episodios parseado, un feed en inglés contestado como
`spanish:false` y la dirección de metadatos rechazada con 400 sin hacer el pedido.
Fuera de los podcasts: la página de la API ocultaba `health` y `music` enteras —el
generador sólo dibuja las secciones de su tabla de etiquetas—, así que ahora están,
con radio y podcasts incluidas.
Las emisoras las busca el servidor, así que dos situaciones que no son bugs se veían
como uno: sin sesión (el modo invitado nunca habla con la api) y una api más vieja
que la app —se despliegan por separado, y un deploy que reconstruyó `web` y no el
contenedor de la api es una pantalla cuyos pedidos fallan todos.
Ahora la sección lo dice y no pide nada en ninguno de los dos casos. Para poder
distinguirlos, `radio` entra en `features` (`GET /api/config`), que es exactamente
para lo que existe esa lista, y queda documentado en la especificación junto con
`features` entero —que hasta ahora no estaba.
De paso: la fila y la barra caen al marcador de posición cuando el logo o la portada
no cargan, que es el caso de una parte del directorio.
Música tiene una sección **Radio**: estaciones en vivo por género (Workout/Rave,
Techno/House, R&B/Soul, Latina, Hip-Hop, Reggae, Chill, Jazz, Rock, Electrónica),
sin publicidad primero —SomaFM y Radio Paradise— y detrás el directorio público de
radio-browser. Nada de esto suma dependencias: la lista la arma api/radio.js.
Tres decisiones que no se ven en la pantalla y son las que hacen que funcione:
- **El audio no pasa por el servidor.** La api entrega la lista y después no ve un
byte: el teléfono habla con la estación. Sin ancho de banda, sin disco, sin copias.
- **La URL del stream viene resuelta en la lista**, porque iOS sólo deja arrancar
audio dentro del gesto del toque: cualquier cosa asíncrona entre el dedo y el
play() es un botón que no hace nada, sin error en ninguna parte.
- **El `<audio>` vive fuera de React** (lib/radio-player.js): un elemento dentro de
un componente se desmonta con él, y eso es la música cortándose al cambiar de
pantalla — justo lo que no puede pasar en medio de una serie.
Barra arriba de la barra de pestañas con pausa (deja la estación donde estaba) y
parar; Media Session pone estación, pista y controles en la pantalla bloqueada, y
las canciones siguen con el teléfono en el bolsillo. Qué suena lo dicen SomaFM y
Radio Paradise y nadie más: en el resto la barra muestra la estación en vez de
inventar una pista.
api/test/server-radio.test.js guarda las dos puertas (sesión obligatoria, `src`+`id`
reconstruidos en vez de confiar en el objeto del cliente); RadioBar.test.jsx y el
caso de la fila en Music.test.jsx guardan lo demás.
También: radio.js en el COPY del Dockerfile —importar un archivo que no está copiado
es un contenedor que arranca en ERR_MODULE_NOT_FOUND—, /api/radio y /api/radio/now
(con /api/music/lookup, que faltaba) en la especificación, y docs/RADIO.md.
"¿Cómo superviso los usuarios que se han creado, los que están logueados y todo eso?" — no se podía,
y la causa era de despliegue: `ADMIN_UIDS` es la ÚNICA forma de ser admin (nada en el código pone
`user.admin`), y este compose lista el entorno variable por variable, así que llegaba al host y nunca
al contenedor. Sin ella el servidor no ofrece `/api/admin/*`, `/api/me` responde `admin: false`, y la
fila "Admin dashboard" no aparece en Ajustes: el panel existe y no hay puerta.
Ahora el compose pasa las diez que faltaban: `ADMIN_UIDS`, `INVITE_ONLY`, `ALLOW_GUEST`,
`SESSION_DAYS` (los interruptores de la instancia) y `AUDIT_LOG`, `AUDIT_MAX`, `AUDIT_DAYS`,
`AUDIT_IP` (los límites del registro de actividad), más `VAPID_SUBJECT` y `REMINDER_TICK_MS`. Con los
`:-` de siempre: una instancia que no las ponga queda exactamente como estaba.
`docs/SELF_HOSTING.md` dice ahora, en el paso donde se habla de `ADMIN_UIDS`, que es la única puerta
de entrada al panel y cómo leer los ids de una instancia que ya corre (un `node -e` sobre db.json
dentro del contenedor, sin instalar nada).
Reportado así: "Mira mi entrenamiento y dime qué cambiarías" → *The Coach answered with something the
app couldn't use*, mientras que "¿Cómo fue mi sesión de Back & Triceps?" funcionaba. El código ya sabía
la razón y la tiraba: el parser y el validador devuelven qué campo falló, y `pipeline.js` la descartaba
— el registro guardaba sólo la clase de error, así que ni la persona ni el dueño podían distinguir
prosa de un JSON cortado a la mitad, de un tipo de cambio que no existe, de un ejercicio que no está
en el plan.
Ahora `unusable` lleva `detail`: **la queja textual** del parser o del validador, que nombra el campo,
más una descripción de la forma de la respuesta —prosa o "empieza como JSON", y cuántos caracteres—.
Sin citarla nunca, y eso es deliberado: este renglón va al registro de instancia, que es visible para
el admin y abarca a todos los perfiles, y ese registro lleva conteos y resultados, nunca los datos de
una persona. Unos pocos caracteres de un plan serían exactamente cómo esa regla se rompe. La longitud
más la forma es lo que separa "el modelo ignoró el modo JSON" de "la respuesta se cortó", y no dice
nada de nadie.
En el prompt de reparación esto es la *segunda* respuesta — la que el modelo manda después de que se
le dijo qué estaba mal en la primera —, que es lo más informativo que hay: un modelo que no puede
arreglar una queja que acaba de recibir es el problema, no este archivo.
Documentado con la tabla de clases de error y qué significa cada una (`docs/AI_COACH.md`), porque el
patrón que se reportó se lee solo con ella: el debrief es fácil —todo cadenas y un número— y el review
es la tarea más difícil —una lista de cambios tipados, con objetivo, antes/después y un motivo de una
tabla fija—. Un modelo que debriefa bien y no puede con el review es un enunciado sobre el modelo.
Mutation-check: si el detalle vuelve a estar vacío, el test falla. API 279 en verde.
"Para que Jev tome decisiones debía mirar la sesión de progreso, que tiene todos los datos de los
entrenamientos pasados." Exacto, y no lo hacía: el estado llevaba una ventana de cuatro semanas, las
últimas tres sesiones en detalle y un puñado de conteos. Un ejercicio que no se mueve desde hace tres
meses se veía exactamente igual que uno que nunca se entrenó, que es justo la diferencia sobre la que
un plan tiene que decidir.
Ahora el estado lleva, por ejercicio y sobre **todo** el histórico:
· cuántas sesiones, y el mejor set de la primera y de la última;
· el mejor de siempre, con su fecha;
· una serie de hasta diez estimaciones, una por sesión, para que se vea la *forma* y no dos extremos;
· la dirección: las últimas tres sesiones contra las tres anteriores — no contra el récord de
marzo, porque un ejercicio que batió su récord en marzo y está plano desde entonces no progresa;
· y el cuerpo al que pertenece, para que una decisión de selección sepa de qué parte del cuerpo habla.
Más: la carga y el volumen por semana de las últimas diez, los totales de todo el histórico (sesiones,
series, desde cuándo entrena, cuántos sets en total) y los estancamientos del bloque actual. Los topes
son de lo que se *muestra* — 12 ejercicios, 10 puntos, 10 semanas — nunca de la aritmética: cada número
se calcula sobre todas las sesiones que el perfil tenga, y hay un test con 40 sesiones y cinco meses de
historia que falla si alguien mete una ventana otra vez.
La estimación de 1RM se comparte en vez de duplicarse: `api/coach/core/strength.js` es un espejo
deliberado de `frontend/src/lib/onerm.js` — mismo Epley, mismo tope de 12 repeticiones, mismas dos
exclusiones (series de calentamiento; máquinas asistidas, cuyo peso es la ayuda recibida y no la carga
levantada) — y `cohort.js`, que tenía su propia copia del cálculo, ahora usa esa. Un plan escrito desde
un número distinto al que dibuja la pantalla de Progreso es un plan que nadie puede verificar, así que
la fórmula vive en dos lugares a propósito y los tests la comparan con los mismos ejemplos.
Los ids de ejercicios del histórico viajan con su nombre, en la misma línea que ya lo hacían los
estancados: una decisión sobre *qué ejercicio cambiar* tiene que nombrar algo que la app pueda editar.
Tests: el histórico largo, las tres direcciones de tendencia, el tope de puntos con la aritmética
intacta, el volumen de una serie por tiempo (un set sin repeticiones suma al conteo y nada al volumen)
y la estimación compartida. API 279 en verde, frontend 1705.
Recordado como "para mejorar las decisiones en la selección de entrenamiento debe usar Jev y ChatGPT
combinado". La combinación estaba a medias por dos razones, y las dos se cierran acá.
**El juicio no estaba cuando se escribía el plan.** Viajaba al payload sólo si alguien lo había pedido
en Salud hacía menos de seis horas; en la práctica, muchas veces no estaba. Ahora un trabajo del Coach
—crear o revisar— **pide su propio juicio** cuando no hay uno fresco (`insightForCoach` en
`api/insights.js`), con el mismo cupo que gasta el botón de Salud, así que lo automático no puede
costar más que lo manual. Un debrief queda afuera: un veredicto de disposición no habla de una sesión.
Y si el proveedor falla, si la instancia no tiene clave o si el cupo se agotó, el trabajo sigue
exactamente como antes — el juicio es contexto, nunca una dependencia, y hay tests para los tres casos.
**Las preguntas no cubrían la selección.** Jev juzgaba disposición, descarga, limitante y métrica a
vigilar; nada sobre *qué cambiar*. Ahora, además de `volume` (hacia dónde va la carga de la semana,
cuando hay historia suficiente para tener opinión), recibe **una pregunta por ejercicio estancado**:
`keep`, `reduce`, `swap` o `drop`, con la clave del id de la biblioteca y el nombre en la rúbrica —
así la respuesta es algo con lo que el plan se puede editar y el modelo lee palabras, no una clave.
Los ids de ejercicios pasan a viajar en el estado, y sólo ellos: un id de biblioteca es una fila de un
dataset público, no un identificador de persona, y el test de privacidad lo dice ahora en esos
términos.
Hay una sola forma de producir un juicio: `runInsight` en `api/insights.js`, que usan la ruta de Salud
y el trabajo del Coach. Antes esa lógica vivía dentro de la ruta, con sus helpers duplicados en
`server.js`; ahora la ruta es una envoltura fina y no hay dos maneras de pedir, cobrar o guardar.
En el prompt del escritor quedó dicho con precisión qué es un `swap`: **una propuesta a considerar**,
no una decisión a aplicar. Si la evidencia que el propio modelo ve dice que el ejercicio está bien,
puede decir por qué y dejarlo; el cambio que envíe tiene que cumplir el esquema y nombrar un id real.
Tests: seis del runner y de la regla de cuándo preguntar (contra un gateway de mentira, sin levantar
servidor), más los de las preguntas nuevas. API 276 en verde, frontend 1705.
Preguntado como "¿Jev está integrado en el Coach para crear o revisar, según mi peso, mis medidas y
los entrenamientos que ya he hecho?" — y la respuesta honesta tenía dos huecos, que este commit
cierra, y uno que no.
**Lo que ya estaba.** El payload del Coach lleva el cuestionario (objetivo, experiencia, días,
minutos, equipamiento, limitaciones), tu plan, `history.workingWeights` (el mejor peso que ya
manejaste en cada ejercicio, para que las cargas iniciales partan de evidencia), `window` +
`aggregates` en una revisión (las últimas tres sesiones serie por serie, las anteriores resumidas,
estancamientos, adherencia, series por parte del cuerpo), tu peso de las últimas semanas y la segunda
opinión de Jev cuando tiene menos de seis horas.
**Lo que faltaba.**
· **Una semana de Apple Health no llegaba nunca**: el Coach podía leer tu entrenamiento y no tu
recuperación. Ahora `health` viaja en el payload — por métrica y por campo, el promedio diario,
el valor más nuevo y cuántos días tienen datos, con tope de ocho métricas y en el orden del
catálogo. Promedios y no el archivo, a propósito: "durmiendo 6,2 h contra 7,1 la semana
anterior" cambia una decisión de volumen, y 288 muestras de pulso sólo gastan tokens. Va en
crear y en revisar; no en el debrief, porque el promedio de una semana no dice nada de una sesión.
El resumen vive en `jev.js`, junto al orden de métricas que ya usaba, y `jobs.js` lo lee del
mismo archivo que el teléfono escribe.
· **Al crear un plan no le llegaba tu peso.** Revisar y debrief siempre lo llevaron; crear no. Un
plan nuevo se escribía sin saber si estás en déficit o subiendo. Ahora el payload de crear lleva
el objetivo y los últimos ocho pesajes.
· Ambas cosas se documentan al modelo en `prompts/common.md`, con su límite dicho: dos días con
datos no son una semana, así que no se lee una tendencia de ahí.
**Lo que no existe, y lo digo en vez de dejarlo creer: medidas corporales.** La app guarda peso y
nada más — ni cintura, ni pecho, ni brazo. No hay dónde escribirlas, así que "según mis medidas"
todavía no es algo que esta instancia pueda hacer; lo que el Coach lee es la serie de peso. Está
escrito así en `docs/AI_COACH.md`, con la tabla de qué entra en el payload y de dónde sale cada cosa.
Tests: el resumen (promedios por campo, ventana, orden, métricas fuera de la ventana descartadas,
tope de ocho) y el payload (el resumen reducido y saneado, la clave ausente en vez de un objeto vacío,
y el peso en crear). API 269 en verde, frontend 1705.
"En mi Apple Salud me dice 946 y en opengym 1700 y pico", y antes 499 contra 840. Ese factor —1,80 y
1,68— es la prueba: una suma de valores acumulados daría 12× o 24× al final del día, no 1,8×. Lo que
da 1,8× es **sumar dos dispositivos**. HealthKit de-duplica la misma caminata entre el Apple Watch y
el iPhone, la app Salud la cuenta una vez, y un payload que trae los dos como puntos separados no la
ha de-duplicado nadie. La tarjeta estaba leyendo dos cosas, exactamente como se sospechó.
Ahora cada cubo —una hora, y el día cuando el teléfono manda un total por día— **guarda sus fuentes
por separado y muestra una**: la que más reportó en ese cubo, después la más nueva, después la más
grande. No es una suma, no es un promedio y no es "el máximo": es el agregado propio de un
dispositivo, o sea el número que ese dispositivo muestra.
Y la elección es **por hora**, no por día, que es lo que hace correctas las dos situaciones a la vez:
una hora que solo registró el teléfono es del teléfono (no se pierde nada), y una hora que
registraron los dos se cuenta una vez (no se duplica nada). Con la elección por día, el caso
"caminata sin el reloj" se habría perdido.
Tres cosas que había que cuidar y están cubiertas por tests:
· **Un payload sin `source`** —casi todos, y en iOS 27+ es lo normal para datos acumulados— vive en
una sola fuente sin nombre, así que un cubo es el cubo y nada cambia para quien tiene un solo
dispositivo. Los 22 tests que ya existían pasaron sin tocarlos, que es la evidencia de eso.
· **Un cubo guardado antes de esto** se adopta como la fuente sin nombre en vez de tirarse: una
actualización no pierde el día que ya tenía, y las dos compiten por cantidad de muestras.
· **Reemplazar una hora borra solo la de esa fuente.** La hora en curso crece en cada envío de un
automatismo de cinco minutos y por eso se reemplaza, pero reemplazar el cubo entero es cómo un
dispositivo borraría en silencio el reporte del otro — que es lo contrario de lo que esto hace.
La hoja lo dice al final: `N días con datos · Apple Watch, iPhone · se usa Apple Watch`, para que el
número se pueda cotejar contra el dispositivo que lo produjo.
Cinco tests del merge más el orden de desempate. Mutation-check de las dos mitades: sin aplicar la
fuente ganadora fallan cuatro, y si reemplazar una hora borra la del otro dispositivo fallan tres.
API 267 en verde, frontend 1705, build OK.
"Las actualizaciones están llegando pero las tarjetas no tienen los mismos números que Salud." Las
actualizaciones llegan, entonces: el problema es qué se hace con ellas, y hay dos formas de que un día
salga más grande de lo que el reloj dice.
**El total del día leído como hora 00.** Si HAE manda el total del día con marca de medianoche en el
mismo payload que las horas, ese punto caía en el cubo de las 00:00 y la suma del día lo contaba
además de las horas — 499 declarados + 341 de horas = 840, que es exactamente el número reportado.
Ahora un punto de medianoche que vale más que todo el resto del payload junto es el total del día
(una hora no puede tener más que el día que la contiene) y nunca se convierte en hora 00; un 00:00
chico de verdad sigue siendo la primera hora y se suma como cualquier otra.
**Horas sumadas a un total que ya las contenía.** Con el día declarado por el teléfono, cada hora que
llegaba después se le sumaba encima — el mismo error, una capa más arriba. Ahora el total declarado
**es** el día y las horas nunca se le agregan: son la forma del día, no un segundo número. Su suma
queda al lado, en `hours_sum`, y la hoja de la métrica dice cuando los dos difieren, en palabras:
tanto el teléfono declaró, tanto suman las horas, y cuál de los dos estás viendo. Un total que no se
renueva en seis horas deja de mandar, así que cambiar una automatización de Días a Horas converge en
vez de congelarse para el resto del día.
Y para la otra forma — horas que en realidad son **totales acumulados** en vez de deltas, que también
suman de más — cada envío deja un **recibo por métrica**, visible en la hoja: cuántos datos llegaron,
cómo vienen marcados (un total por día, uno por hora, muestras sueltas o mezcla), de qué fuentes,
cuánto suman y los tres últimos valores. Una corrida de números que suben (340 → 420 → 499) es la
señal de que son acumulados, y eso es la diferencia entre 499 y 840 vista en la pantalla en vez de
deducida. Es un recibo, no una lectura: el campo que cita se elige por una lista fija porque este
módulo no tiene el catálogo, y nada de él entra en el cálculo de un día.
Seis tests nuevos del merge y del recibo, dos de las filas de la hoja y uno de render por la hoja
real. Mutation-check de las dos mitades del arreglo: leer el total como hora 00 falla, y sumarle las
horas al total declarado falla. API 261 en verde, frontend 1701, build OK.
Preguntaste si se podía implementar Jev, y con qué API. Resulta que Jev se sirve por OpenCode Zen,
así que una sola cuenta cubre esto y cualquier otra cosa apuntada a ese gateway:
POST https://opencode.ai/zen/v1/systemone Bearer <clave> model: jev-1.13
Y ahí está la razón de que valga la pena: Jev no es un modelo de chat. Le mandás un *estado* y
preguntas tipadas — sí/no (`noul`), opción (`choice`), rúbrica (`score`) — y contesta todas en una
sola petición con el valor **y la probabilidad que le puso**. "62% probable" se puede discutir;
"tomate una semana de descarga" no. Así que no entra por el Coach (que necesita *escribir*) y no se
fuerza dentro de su lista de proveedores: tiene su módulo, sus dos rutas y su tarjeta.
Qué hace. En Salud, arriba de la grilla, una tarjeta con cuatro respuestas: qué tan listo estás para
entrenar fuerte (nivel 1-5, con el número al lado), si la semana pide bajar carga (62% probable), qué
parte del cuerpo parece menos recuperada, y qué métrica de salud merece atención — esa última con la
última lectura de la métrica que nombró, para que "vigilá tu frecuencia en reposo" venga con el 62
que lo motivó. La hoja detrás del ⓘ dice a dónde va y exactamente qué se envía, con el mismo resumen
que devuelve el servidor.
Lo que sale, y lo que no. Se decide en `api/jev.js` y son agregados: una semana de cada métrica por
campo como la escribió el teléfono, series por parte del cuerpo de 4 semanas y de la última, sesiones,
días desde la última, RPE medio, estancamientos *por nombre de ejercicio*, el último pesaje y su
cambio. Ningún identificador: ni perfil, ni nombre, ni títulos de entrenamientos, ni ids de
ejercicios, ni chat — hay un test que lo afirma sobre el JSON, porque es una promesa que hacen los
docs y nada más la miraba. La única excepción es deliberada y está documentada: la nota de
*limitaciones* del cuestionario del Coach, porque "hombro malo" cambia la respuesta. (Los títulos sí
estuvieron un rato ahí: los saqué al escribir ese test, y el test se quedó.)
Un juicio no es una instrucción, y el código lo trata así. Cada respuesta se muestra con su
probabilidad; una pregunta que el modelo no contestó se muestra como no contestada, nunca como un
cero; un nivel que no habíamos ofrecido se marca en vez de disfrazarse de propio; y si los datos
cambiaron desde que se pidió (una sesión registrada, una noche que llegó) la tarjeta lo dice en lugar
de seguir pareciendo actual. Tampoco corre por temporizador: cuesta una petición, así que pasa cuando
alguien aprieta *Preguntar*, con cupo por perfil y por día y un piso de diez minutos aplicados en el
servidor, no en la pantalla.
El Coach, además, lo recibe como `secondOpinion` en su payload **solo si tiene menos de seis horas**,
como evidencia con confianza adjunta para citar en `why`, nunca como una orden ni como un cambio de
plan. Es la mitad que faltaba de "y el Coach escribe con eso".
El lector de respuestas es tolerante a propósito: el contrato de la petición está documentado, la
respuesta no la vimos nunca del servicio real, así que acepta las formas plausibles
(`answers`/`results`, `option`/`answer`/`choice`, `probability` o una distribución sobre los niveles),
normaliza lo que encuentra y devuelve `null` por lo que no puede leer. El cuerpo crudo queda guardado
al lado del parseado (y sale con `?raw=1`): la primera llamada real se puede mirar, y una forma mal
adivinada es un arreglo, no un misterio.
Dos cosas que encontré escribiendo esto y que quedan arregladas: una variable de entorno vacía se
leía como **cero** (`Number('')` pasa un chequeo ingenuo), así que un cupo sin configurar era "cero
peticiones" — un feature que parece configurado y no funciona nunca; y agregar la palabra *Back*
para la espalda redefinió el botón *Atrás* de la app a "Espalda", porque en un objeto literal la
última clave gana y nada lo dice. El catálogo de español tiene ahora un test que falla si una clave
se escribe dos veces, mutación comprobada.
Cobertura: 11 tests del módulo (el estado, las preguntas, cada forma de respuesta, la promesa de
privacidad, el cupo), 5 de las rutas contra un gateway de mentira y el servidor real, 6 del modelo de
vista en el frontend y 5 de render por la tarjeta real. API 259 en verde, frontend 1696, build OK.
"Podemos reiniciar los números de esas mediciones para yo enviar el de hoy." The whole-file reset
already existed two taps away in the setup sheet, but it is the wrong size for the question: the
four metrics he suspects are not the profile. Throwing away a month of heart rate to start steps
over is not a reset, it is a tax.
So a metric can now be forgotten on its own: the detail sheet has **Reset this measurement**, which
deletes that metric's days (and hours) and nothing else — the other metrics, the workouts and the
ingest key stay. With any Date Range wider than a day the phone re-sends that metric on its next
sync, which is what makes this a reset rather than a loss: Apple Health still has the data, and a
day total replaces the day it names, so the stored past is rewritten rather than duplicated.
The two destructive rows are worded apart on purpose and the confirm names the metric ("¿Reiniciar
Pasos?"), because the neighbouring action in the setup sheet takes every metric there is.
`dropMetric()` is pure and returns how many days it took, and the route answers `metric: null` for
a metric the profile does not have (or a profile with no health file at all) instead of an error —
a screen that says "nothing stored" is more useful than a 404 answering a button press. Tested
from both ends: the helper's purity and arithmetic, the route against a real server (one metric
gone, the others and the workouts intact, the key still working, and a re-sync rebuilding it), and
the sheet's flow through the real confirm. Mutation-checked: pointing the row at the whole-file
delete fails it.
Reported as "le doy a cualquier actividad y solo me presenta los pasos de hoy… debiera
presentarme una medida por hora, y no me da el histórico". Two separate things, and only one
of them was the app's fault.
**The history was the automation's setting.** With Date Range on its default (`Today`) every
sync carries today and nothing else, so there is exactly one day in the file to draw. That is
why a card looked frozen: not a rendering bug, a range that was never sent. The setup steps
now say `Previous 7 Days` and say why.
**The hours were thrown away by us.** Even when the phone sends 288 readings a day, the
receiver folded every one of them into a single day aggregate, so "8,123 steps today" was all
there could ever be — a number you cannot look into. Worse, the recommended setting was Time
Grouping `Days`, which sends one point per metric per day: the intraday detail never arrived
in the first place. The recommendation is now `Hours`, and the storage keeps the hours.
The merge rule for them is the same shape as the day rule, for the same reason: a payload
whose datapoints all sit on the hour is HAE's own hour grouping, and the hour *in progress*
grows on every run of a five-minute automation, so it is replaced and never unioned — 500 +
900 + 1,340 steps in one hour is a number no watch recorded. The day is then recomputed as
the sum of its hours, which is what keeps the card and the detail from ever disagreeing, and
which also makes switching an automation from Days to Hours mid-day converge instead of
double-count. Raw samples (real timestamps) still union by instant plus numbers, and they now
land in their own hour, which is where intraday detail comes from when nothing is grouped.
Three things that would have been silent bugs, caught while writing it:
- The hour rule is decided from the **whole payload**, never from one timestamp. A five-minute
automation produces samples that sit exactly on the hour, and reading one of those as an hour
total wipes the hour it belongs to. There is a test with a 09:00:00 and a 09:05:00 sample in
one payload, and it fails against the per-point version of the rule.
- A day that arrived as a day total keeps its hours beside it, and a day stored before this
existed keeps its aggregate when the first hour shows up — recomputing it from hours it does
not have would delete 2,000 steps. Both are mutation-checked (removing either guard fails a
test).
- A payload grouped by hour writes the ledger row anyway, because a later payload with real
minutes can describe the same instant and the union path can only see the ledger. Without it
the raw-sample route test double-counts a single sample.
The hours are the bulky part of this data, so they are kept for a week (the day aggregates
still live the full 400 days), pruned when the night's file is written, and fetched one metric
and one day at a time — `GET /api/vitals/hours`. A screen listing forty cards downloads none
of them; the day view carries only a count per day, which is what tells the sheet whether it
is worth asking. The sheet draws the hours, the days before it (tapping one moves the hour
list to that day), and every field the watch sent; when the automation groups by Days it says
so instead of leaving a gap where a chart should be.
Coverage: 6 new tests in `api/test/vitals.test.js` (19 total) and a route test in
`api/test/server-vitals.test.js` (5), the hour/history model in `vitals-view.test.js` (31),
three render tests through the real sheet, the route documented in `api/openapi.yaml` and
`website/api.html`, and `docs/HEALTH.md` with the settings, the new merge row and the two
symptoms now in Troubleshooting.
**The transparency was there and invisible.** `--glass` was a near-black at 55% alpha, and a
dark film over a dark background reads as solid no matter what the alpha says — so the cards
looked exactly as opaque as before. It is 34% now, the family tint weighs a little more
(14%) and the blur is 10px instead of 16: heavy blur flattens the backdrop into one colour,
which hides the very thing that is supposed to show through.
The opaque `@supports` fallback is gone as well. It was copied from the tab bar, where it is
right — the bar floats over scrolling text — and it is wrong here: a card sits in the page
flow and the only thing behind it is the aura. On any device that took that branch, the
cards were solid by construction.
**The splash now waits, which is what a launch screen does.** It stays until the boot is
finished, with a floor of 1.1s so it can actually be read (a warm boot takes milliseconds,
and a splash that lasts that long is a flicker) and a ceiling of 6s so a request that never
answers cannot hold anybody behind a photograph — their workouts are already local. The mark
pulses slowly while it waits, so it looks like a screen that is loading rather than a
photograph that is stuck.
**The long white is iOS, before any of our code runs.** The deployed HTML already carries
the aura's base colour inline, so what is left is the installed web app's own launch screen:
iOS paints it before the page exists, and without an `apple-touch-startup-image` that
matches the device it paints nothing. Fourteen entries now cover the phone and tablet sizes
the app is opened on, cropped from the same photograph (each device fetches only its own).
build-app-icons.mjs fails when the sizes it generates and the sizes index.html links
disagree, because a missing entry is the blank screen this exists to remove.
Three things the screen was missing, plus the launch photo.
**Today.** The period filter started at 30 days, which buried the question a five-minute
cadence exists to answer: what do the numbers say right now? "Today" is now first and the
default, and it means today — the grid drops metrics nobody has measured today (the scale
is not stepped on every morning), and if nothing has come in yet the grid falls back to
everything and says so rather than showing an empty screen. The number on every card was
always the newest reading; what is new is that the card says which day it is and when it
landed ("hoy · hace 12 min"), so the claim can be checked instead of trusted. The screen
also refreshes itself every minute while it is open, which is what makes a five-minute
cadence visible.
The filter and the charts want different windows, and the view keeps them apart: a
sparkline or a trend needs history, so the fetch never asks for less than a week even in
"Today", and anything labelled with a window says which one it is. (The alternative —
fetching one day and drawing nothing — would have made Today the one mode with no charts.)
**Chart panels.** Every tile carries a 52px sparkline, which shows a shape and cannot be
read. The first few metrics in the catalogue's own order now get a full-width panel each:
axes, the window's min / avg / max, and the card's own colour, so a panel and its tile are
recognisably the same metric.
**The aura.** index.html carries the three "Diamond Weave" layers and index.css puts the
base colour on `body` where the blend modes composite against it, with `#app` lifted to
z-index 1 so the absolutely-positioned layers cannot paint over the page (everything modal
was already higher). Dark keeps `screen`; the light theme switches the same layers to
`multiply`, because screened amber over white is amber that has been washed away. The blur
radii follow the spec per breakpoint, and the layers are fixed rather than absolute so
scrolling never repaints two 200px blurs.
**The launch screen.** assets/splash.jpg is a 3862×5786 photograph from a camera, so
nothing ships it raw: build-app-icons.mjs now derives public/splash.webp (1170px wide, 62 KB
— WebP because it is a photo) for the boot screen and resources/splash.jpg (2732×2732,
fitted on the aura's base colour rather than cropped, so a portrait composition survives)
for @capacitor/assets. The 12 MB original is gitignored: the derived files are committed,
so a clone still builds, and the script says what is missing when regeneration is asked for
without it.
Every icon the app ships now comes from one source image, generated rather than drawn:
frontend/scripts/build-app-icons.mjs writes public/icon-512.png (declared "any maskable"
in the manifest, hence an opaque square), public/icon-180.png (iOS home screen and
favicon), public/logo.png (transparent, for the UI) and resources/icon.png (the
@capacitor/assets source for the native shells).
The file was a PNG despite its .jpeg name — it has a real alpha channel — so it is
assets/logoym.png now. It is the file the owner dropped in, and the icons are derived
from it, which is what keeps the PWA icon, the home-screen icon, the in-app mark and the
native icon from ever drifting apart.
The emblem is dark green (its most common colour is #031808, its accents are greens too)
with transparent corners, which decides two things. The icon squares are filled with that
same dark green and the mark is centred at 88% of the canvas: the corners blend into it,
the maskable safe circle stays clean, and a transparent icon can't disappear on a dark
home screen. And the tab bar's Start button keeps the accent as a RING instead of a fill —
on the old lime disc the emblem would have read as a dark blob. The ring still marks the
primary action, and it still turns orange with the pulse while a session is running, with
the label underneath saying Start / Resume / Workout, so nothing that button communicated
was lost by swapping its glyph for the mark.
Login, the mobile onboarding and the boot placeholder in App.jsx showed the dumbbell glyph
as a stand-in for the brand; they all show the mark now, so the app cannot flash a
different logo on its way in. Three now-unused Icon imports go with it.
Icons are written as 256-colour palettes: measured against the full RGBA versions the mean
per-channel error is 1.5/255, invisible, and the files are ~2.5× smaller (161 KB for
everything the browser downloads, against 532 KB of source). Transparency survives it as
the palette's own alpha entries — verified, not assumed.
docs/MOBILE.md says how to regenerate and why resources/icon.svg is now inert
(@capacitor/assets tries .png before .svg, so the new icon.png wins), and that comment is
repeated in the SVG itself so nobody edits the file that no longer decides anything.
The tab bar is a flex row of equal columns with the Start button raised in the
middle, so the tab count has to stay odd. Adding Salud as a sixth pushed that disc
half a column to the right, and it read immediately as "the button moved" — the
app's primary action is the one thing in the bar that must not drift.
Salud is now the heart button in Home's header, next to the gear, with the same
destination and the same route (/health). It is reachable from Settings → Data as
well, which was already there. The tab bar is back to five: Home, Plan, Start,
Stats, Exercises.
Two tests, because this is the kind of change that regresses silently: TabBar.test.jsx
asserts the odd count and that the raised button is the middle child (plus that no tab
points at /health), and Home.health-door.test.jsx asserts the heart sits in the same
non-shrinking container as the gear and navigates to /health — if that breaks, the
screen is only reachable from Settings, where nobody looks for it.
Also: the Comments in Home, TabBar, README, CHANGELOG and docs/HEALTH.md now say
where Salud is, and one test assertion checks flexGrow/flexShrink rather than the
`flex: none` shorthand — the CSSOM rewrites that to `0 0 auto`, which is what the
first version of the test tripped over.
An iOS automation in Health Auto Export POSTs Apple Health to /api/vitals/ingest,
and the new Salud tab (next to Plan) draws whatever arrived: steps, heart rate,
sleep, weight, oxygen, workouts and every other metric HAE can export, grouped into
cards with a trend, a sparkline and a 7/30/90/365-day range. Nothing on that screen
is an input, and the watch's workouts stay out of the history on purpose — they
carry no sets and no weights, so folding them into progression, PRs and the recovery
model would be inventing data.
The interesting part is duplicates. A five-minute automation re-sends overlapping
windows: with Date Range "Today", appending would count a day of steps again on
every run, and with "Since Last Sync", replacing would throw away everything but the
last five minutes. So the endpoint decides per payload instead. Datapoints that sit
on midnight are HAE's own day grouping, i.e. a *total*, and a day total replaces the
day it names — re-sending the same day all afternoon converges on that day's total.
Anything else is a real sample, identified by its instant plus its numbers and
stored once, which is right for overlapping and disjoint windows alike. Every sync
answers with a receipt (received / duplicates / stored), so a misconfigured
automation is visible rather than silent, and day keys come from the date the phone
wrote — never the server's clock, or every evening's steps would land on tomorrow.
Per profile and private by construction. Each profile mints its own ingest key
(Salud → ⚙), which is write-only: it can add to that one profile's health file and
cannot read a single number back, so a key leaking out of a phone is a nuisance
rather than a disclosure. It is its own credential, so rotating it disconnects a
phone without signing anybody out anywhere. The data lives in
data/vitals-<uid>.json, outside the synced state document, so a year of heart rate
never round-trips through localStorage on every device, and it is bounded on write:
400 days per metric, a 72 h dedupe ledger, the newest 300 workouts.
Two traps that only exist in production, both fixed here and both of which would
have shipped broken. api/Dockerfile copies the modules server.js imports by name,
and vitals.js was not on that list — a container that boots straight into
ERR_MODULE_NOT_FOUND. And the web container's nginx capped every /api body at 5 MB,
which a health export with Summarize Data off exceeds; that one route now gets the
API's own 32 MB while every other path keeps 5 MB, with the shared proxy settings
hoisted to server level so the two locations cannot drift apart.
Coverage: vitals.js (13 tests — overlapping, disjoint, day-grouped, raw, heart rate,
sleep, blood pressure, pruning, timezones), the routes against a real server (4 —
isolation between profiles, a key that cannot read, ten re-sends changing nothing),
the card model (18) and the screen (4). docs/HEALTH.md has the Health Auto Export
settings and the merge table; the five endpoints are in api/openapi.yaml under the
health tag, and website/api.html is rebuilt from it.
The app is now KuentaGYM everywhere a user can see it, and a fresh profile no
longer starts on upstream's English/kg defaults. Both are this fork's decisions,
so both are pinned by tests rather than left to a find-and-replace.
Rename (1,270 references, 149 files)
- Visible surfaces: the Login/Home/mobile-onboarding wordmark, the Settings
version line, the printed plan, the PWA title + manifest, and the 17 branded
strings across all 14 locale packs.
- Infrastructure: repo links, the container images and the release endpoints now
name git.dploy.lol/dsantillan/kuentagym; .gitea/workflows/docker-publish.yml
publishes to this forge's registry instead of gitea.com.
- The Android/iOS application id stays ch.duartesantos.opengym on purpose:
changing it would make the mobile app a different app that could never update
an installed copy.
Three things the mechanical pass would have broken, fixed here
- The update check asked gitlab.com for upstream's releases and would have
installed upstream's APK, putting the old name back on the phone. It now reads
this fork's Gitea releases API (the assets shape differs), with the tests
rewritten to the payload Gitea actually returns.
- Renaming the mobile state/pairing files (opengym-state.json,
opengym-remote.json) would lose the on-device copy of a history whose WebView
storage may have been evicted, and silently unpair the device. Both are read
under their old names and written forward under the new ones.
- Renaming the exported plan-file marker (openGym_plan) rejected every plan
shared before the rename as "not a plan file". Both markers are accepted.
Defaults: pounds and Spanish
- DEF.unit = 'lb', DEF.lang = 'es', plus every fallback that independently
assumed en/kg (the <html lang> attribute, the Settings pickers, the Store, the
MCP, the Coach payload).
- Server-generated push copy existed only in English and pt-BR, so a Spanish
profile would have been notified in English; Spanish added.
- The demo seed states unit: 'kg' — its seeded numbers are kilograms, and
inheriting the new default would have introduced an 82.4 lb lifter benching 60.
- The module-level language in i18n-core stays English: it is the only language
whose strings need no pack, so `t()`, dates, numbers and lists agree before a
pack loads. Starting there on 'es' formats a Spanish-shaped UI with English
strings.
Also
- api/package.json's test glob missed push-messages.test.js and
verify-error.test.js, which sat beside the modules they cover and never ran.
- README, docs/, website/ and the issue templates no longer describe upstream's
GitLab/GitHub pipeline, Discord, sponsorship or public demo as if they were
this fork's; upstream history and attribution are preserved (NOTICE.md).
The app's assets were already relative — the shell loads fine from any directory, which is how
the demo lives under /demo/. What assumed the site root was the API call: `fetch('/api/...')`
went to the proxy's own root, where there is nothing to answer it, so behind
`https://example.com/gym/` the app booted and then could not talk to its server.
It now asks its own address instead: `appBase()` reads the directory the app is being served
from, which the router never leaves — every screen is a hash, and a path that is not a file is
sent back to the app's root before React boots. A proxy that strips its prefix (Caddy's
`handle_path`, Traefik's StripPrefix) therefore needs no configuration at all.
For a proxy that passes the prefix through, the web container takes `BASE_PATH=/gym`, rendered
into its nginx config at start-up like the other settings, so it applies to a prebuilt image.
Wired through docker-compose.yml as well — a documented setting the compose file does not pass
on is no setting at all.
Both shapes were checked in containers rather than read: with BASE_PATH empty the shell, the
assets, /api and the deep-path redirect behave exactly as before; with BASE_PATH=/gym all four
work under the prefix and the redirect stays inside it. The first attempt passed at /gym/ and
404'd /gym/assets/app.js, because a regex location outranks the prefix block and never saw its
rewrite — the cache-control blocks carry it too now. The built app was then loaded in a browser
under /gym/ and its own requests go to /gym/api/config and /gym/api/me.
Reported by leon332157.
iOS fetches the Home Screen icon outside the page, without the session cookie
(observed on iOS 26.6 behind Teleport: the page and the manifest reach nginx,
the icon request never does, iOS draws a letter tile). The manifest attribute
in the previous commit covers the manifest fetch; the icon fetch is the proxy's
to exempt. Names the knob for Authelia, Authentik, Cloudflare Access and
oauth2-proxy, and says what a proxy without path exemptions has to do instead.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A push to main or a v* tag on GitHub is forwarded to gitlab.com by a workflow, fast-forward
only, main before the tags so the tag pipeline finds its commit on main. Pull mirroring on
gitlab.com is paid, so the push runs from this side; it needs a project token with the single
scope write_repository (Maintainer role, for the protected main and v*) as the secret
GITLAB_MIRROR_TOKEN, handed to git through a credential helper rather than a URL.
README, CONTRIBUTING, MOBILE and the changelog now say what the site says: issues and pull
requests on GitHub, the GitLab mirror only for the CI that builds the release artefacts, the
merge requests still open there reviewed until they are through.
The README, CONTRIBUTING, MOBILE and SELF_HOSTING pages said the GitHub repo was offline and
GitLab was the only home. The account is back: GitHub gets the tags, the releases v1.2.9 to
v1.3.5 with APK and checksum, the GHCR images and the Pages demo; GitLab keeps its CI, issues
and merge requests. Links now name both, the pages.yml comment no longer calls itself dormant.
build:apk was a manual job on main since it cost ~8 shared-runner minutes; the project runner
on the VM pays for it now, so every main push produces the APK (same key as the release,
artifact at /-/jobs/artifacts/main/browse?job=build:apk) and a broken Android build is caught
before the tag. Merge requests keep the manual button.
build:ios: mobile bundle + xcodebuild archive without a signing identity → unsigned .ipa
(AltStore/Sideloadly), tag builds also into the generic package registry opengym-ios/<ver>/.
Only exists once IOS_RUNNER_TAG names a registered Mac runner; untested until then.
The /api location re-resolves BACKEND on every request, which needs a resolver
address, and that address was hardcoded to 127.0.0.11 — Docker's embedded DNS.
Nothing listens there on another runtime, and an unreachable resolver does not
fail fast: every /api request hangs until it times out, with nothing in the
error log to say why. On Kubernetes that means the app shell loads and the whole
API is dead.
RESOLVER now carries it, defaulting to 127.0.0.11 so Docker and every existing
compose file are unchanged. Kubernetes sets it to the kube-dns service address;
Podman to whatever its network provides. Documented next to the four other
render-time settings in SELF_HOSTING.md, since it belongs to the same "fitting
it into an existing stack" problem.
Move/Swap/Remove and the "marked Current" hint are gated by
S.wc.exerciseButtons (off by default) — the lean default keeps them in
each exercise's ⋯ menu. Also note compact hides the pair buttons and that
list/compact blocks use the compact ExerciseBlock prop.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016QqZBhX7PVNsRqLhkTt9y3
S.workoutView gains a third value, 'compact': the list layout with each
ExerciseBlock rendered `dense` — no media, tag chips ("Best:" included),
note lines, "Last time" recap, bar/plates chip or progression-guidance
line. Just the name, the ⋯ menu and the set rows. Everything stripped is
still on the ⋯ menu or is display-only.
- Settings → During a workout → Workout view is now a 3-way Segmented
(Cards / List / Compact).
- The workout header gains a ⋮ button (menuSheet) that writes
s.active.workoutView, overriding the layout for the running session.
- beginWorkout / beginBackfill snapshot S.workoutView onto s.active, and
the render prefers A.workoutView || S.workoutView — so changing the
saved default never disturbs a workout already in progress.
- 'Compact' added to all 14 locales; pt-BR inheritance fingerprint
regenerated (inherited 613 → 614).
cards / list behaviour is unchanged. Component tests in Workout.test.jsx,
Settings.workoutview.test.jsx and a new sheets.workoutview.test.jsx;
docs/LIST_VIEW.md rewritten to the shipped model.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016QqZBhX7PVNsRqLhkTt9y3
- Instanz-Modus: nur eine persoenliche Anmeldung (Setup-Token/OAuth) bindet sich an das
erste Profil, ein API-Key ist gemessen und wird von allen Profilen unter den Tageslimits
geteilt. Die Bindung passiert jetzt wirklich beim Einreihen eines Jobs (jobs.enqueue),
vorher gab es sie nur in den Tests.
- HTTP-Adapter: 429/500/502/503/504/529 werden zweimal mit kurzer Pause wiederholt, ein
4xx nie. retryDelayMs fuer Tests.
- Payload: Warm-up-Saetze wie in progression.js aus readSession/stalls, done/planned,
Top-Satz, setsByBodyPart und workingWeights herausgefiltert; in vollen Sessions als
warmup:true markiert, common.md sagt dem Modell, was das ist.
- Admin-Karte: .field im Card hat jetzt eine sichtbare Flaeche, die Limit-Zahlenfelder
sind echte Felder statt weisser Browser-Boxen; Text zu 'Whose account pays' unterscheidet
API-Key und persoenliche Anmeldung.
- Neuer Test e2e-apikey: Key ueber die Admin-Routen einlegen, Modelle listen, Review durch
die echte Queue gegen einen lokalen Anthropic/OpenAI/Gemini-Stand-in, inkl. Header,
Cache-Block, Schema, Retry und Auth-Fehler. api 150, frontend 1029, mcp 45 gruen.
Konflikte: zwoelf Locale-Packs (beide Seiten haengen Strings an, sechs doppelte
Schluessel bereinigt), Admin.jsx/admin.css (Coach-Karte bleibt, main-Umbau uebernommen),
Workout/Home/Plan/sheets (main gewinnt), docs.html (Coach-Kapitel war doppelt).
Ungarisch und Thai sind auf main dazugekommen und bekommen die 334 Coach-Strings.
pt-BR-Fingerprint nachgezogen.
Solange der Coach aus ist, zeigt die Admin-Karte einen sauberen Pitch mit einem Knopf statt
halb ausgegrauter Regler; danach ein echter Assistent: nur der naechste offene Schritt ist
aufgeklappt, ein Fortschrittsbalken zaehlt mit, fertige Schritte falten sich zur Quittung.
Arbeitende Knoepfe sind getoent statt grau (List models, Replace key), der deaktivierte
Test-Knopf erklaert, welcher Schritt noch fehlt, Provider-Chips haben einen klaren
gewaehlt-Zustand. Der Coach-Einstieg im Plan ist eine deutliche Karte mit Farbverlauf statt
einer Settings-Zeile. Website: das #coach-Kapitel erklaert Pipeline, Provider, den komplett
lokalen Betrieb inkl. "jedes Modell, das du pullen kannst, kannst du nutzen" und ehrlicher
RAM-/Tempo-Beratung; docs/AI_COACH.md ergaenzt Modellwahl und Performance auf kleinen Boxen.
Was der Coach vorgeschlagen hat, verschwindet nach Ja/Nein nicht mehr: die Chat-Zeile traegt
eine Referenz ins Log, das jetzt jede Aenderung samt before/after (auch abgelehnte), Notizen,
Evidenz und bei Plaenen die Routinen behaelt; eine Recap-Karte im Thread und ein Verlauf-
Sheet oeffnen alles wieder. Unter jeder Review liegen die Zahlen aus dem zitierten Fenster —
Sessions, Dauer, Volumen, Koerpergewicht als Kurve mit Ziel, geschaetztes 1RM erste→letzte
Session, Saetze pro Koerperregion — auf dem Geraet gerechnet (lib/coach-insights.js).
Neu: Job-Art `debrief` (eine Session, kein Planeingriff: Score 1–10, lief gut / beobachten /
naechstes Mal; validateDebrief im Core, eigener Prompt), Vergleich mit anderen auf der
Instanz (Admin-Schalter `community`, pro Person Opt-in serverseitig, Mediane ab drei
Teilnehmern, Epley-1RM, lb→kg; auch als `cohort` im Prompt), und "Routine verbessern"
als fokussierte Review. Schnell-Chips ueber dem Composer, deutsche Strings, Doku, Changelog.
Tests: api 136, frontend 799, mcp 36.
Die Review-Regel verbietet strukturelle Aenderungen unter drei Sessions oder einer Woche
Daten — qwen2.5:3b hatte auf Staging nach EINER Session eine Bein-Uebung entfernt, 'weil
keine Beinarbeit'. Dazu die Changelog-Eintraege fuer den Chat, das Admin-Dashboard, den
Job-Timeout und den 160er-Deckel, COACH_JOB_TIMEOUT_MS in .env.example und in AI_COACH.md,
und Schritt 3 der Doku beschreibt den Chat statt des alten Intake-Buttons.
AI_COACH.md trennt die zwei Provider-Familien (HTTPS mit Key auf dem Default-Image,
Runtime im coach-Image), beschreibt Endpunkt-Regeln, Modell-Liste, Keys pro Provider
samt einmaliger Migration von coach.json und die zwei Wege auf dem Handy. CHANGELOG
unter Unreleased, .env.example/README/Website/SELF_HOSTING nachgezogen.
.gitlab-ci.yml bekommt test:api (Suite, generierte Assets, core-loadable) und
build:api-check, das beide api-Targets baut und laufen laesst: das veroeffentlichte
Image hat kein SDK/codex/bwrap, bootet, und konstruiert die HTTPS-Adapter; das
coach-Image meldet ein lauffaehiges SDK, /coach-auth ist coach 700.
Der Coach-Zweig stand seit v1.2.7. Konflikte: beide Seiten behalten (Server-Imports,
Store-Felder, Home-Titel mit naechster Einheit, history.js), das Dockerfile behaelt seine
zwei Targets und kopiert die neuen Server-Module mit, compose zeigt auf die GitLab-Registry.
pt-BR: die 139 Coach-Strings in die Sie-Form gebracht, Fingerprint nachgezogen.