SatisfactionCapture: a leading count plus noun ("one test fails on CI") parses as an explicit rating and writes a false FAILURES capture

Abierto Apto para principiantes
#2,635 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 7 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
75/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
bun, typescript

Línea de trabajo

Lee hooks/SatisfactionCapture.hook.ts, especialmente parseExplicitRating alrededor del bucle de formas en palabras y la ruta de dígitos en la línea 241; después, inspecciona su uso en run(). Reproduce los casos enumerados de cantidad más sustantivo y los controles de valoración con el script de Bun proporcionado. Se considera terminado cuando esas frases de cantidad ya no se analicen como valoraciones, mientras que las formas explícitas de valoración enumeradas sigan analizándose.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

[!NOTE]
🤖 Aria (AI assistant) responding on behalf of Grzegorz

Version

LifeOS 8.761.0 / SatisfactionCapture as shipped. install/hooks/SatisfactionCapture.hook.ts on main@f6ab5e02 is byte-identical to the file the probe below ran against (diff empty).

What is broken

parseExplicitRating reads a leading count followed by a noun as an explicit rating, for digits and for number words alike. "one test fails on CI" is stored as rating 1 with comment "test fails on CI"; a rating of 3 or lower then writes a FAILURES capture and an Errata complaint against the reply before it. The principal was reporting a CI failure, not grading the assistant. The three guards #1940 added (sentence starter, comment length, imperative) all pass for a plain noun phrase, so this is the residual #1888 and #1940 did not cover. It is the same precision-first concern as #2165: a false hit poisons the ledger, and here it happens on English text.

Where (file:line)

hooks/SatisfactionCapture.hook.ts:241 (word-form loop) and the digit path below it in parseExplicitRating; the FAILURES / Errata writes for ratings <= 3 follow in run().

Repro on a clean tree
gh api repos/danielmiessler/LifeOS/tarball/f6ab5e02 > main.tar.gz
mkdir clean && tar xzf main.tar.gz -C clean --strip-components=1

cat > rating.ts <<'TS'
const { parseExplicitRating } = await import(`${process.env.LIFEOS_ROOT}/hooks/SatisfactionCapture.hook.ts`);
for (const t of [
  "one test fails on CI", "two tests fail on CI", "1 test fails on CI",
  "eight warnings in the build log", "8 warnings in the build log",
  "ten tests fail on CI, check them",
  "three files changed, review them",   // control: a guard already rejects this
  "ten",                                 // control: a real rating
]) console.log(JSON.stringify(t), "→", JSON.stringify(parseExplicitRating(t, "")));
TS

LIFEOS_ROOT="$PWD/clean/LifeOS/install" bun rating.ts
Negative control

On unpatched 8.761.0 the five count-plus-noun sentences parse as ratings 1, 2, 1, 8, 8 and 10, while the guarded control and the bare rating behave as intended:

"one test fails on CI" → {"rating":1,"comment":"test fails on CI"}
"two tests fail on CI" → {"rating":2,"comment":"tests fail on CI"}
"1 test fails on CI" → {"rating":1,"comment":"test fails on CI"}
"eight warnings in the build log" → {"rating":8,"comment":"warnings in the build log"}
"8 warnings in the build log" → {"rating":8,"comment":"warnings in the build log"}
"ten tests fail on CI, check them" → {"rating":10,"comment":"tests fail on CI, check them"}
"three files changed, review them" → null
"ten" → {"rating":10}
Suggested fix

Untested. A score with a comment is separated from it ("8, nice", "8 - nice", "8! great", "8/10 …"); a count runs straight into its noun. Accepting a trailing comment only after a separator (, . ! - — :), or with a bare number alone, would drop all six false hits above and keep every rating form #1940 and #1888 list. #2589's judged path would still catch scores this misses, which fits the precision-first rule.

Related

#1888, #1940, #2589, #2165.


  • I searched open and closed issues for this defect.
  • The repro targets a clean tree of the version above; the output was produced on an install whose hooks/SatisfactionCapture.hook.ts is byte-identical to that tree.
  • The pasted output carries no personal data; every sentence is invented.
Lenguaje dominante
TypeScript
Estrellas
19.7k
Forks
2.5k
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de danielmiessler/LifeOS

Todos los issues de danielmiessler/LifeOS

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.