oracle-gaps: owns in an options object built elsewhere (variable or spread) is read as empty, giving a clean 0-gap headline

Abierto
#75 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
eslint, javascript

Línea de trabajo

Start in oracle-gaps/owners.mjs, where readOwns returns declares true with empty entries for non-literal or spread options. Reuse the existing constant-case refusal message as the model for the new refusal, and check how the eslint-plugin-oracles rule is wired. Read the sibling issue #69 and decisions P6 and P8 first. Done when each generated owns form is either read correctly or refused, and the lint rule reports the same problem.

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

Descripción

Reported from an adopter session, which found it while reviewing #70. Checked at c58b0c2 with readOwns (oracle-gaps/owners.mjs) and end to end. This is a sibling of #69.

Problem. When an oracleProperty call's options aren't an object literal, or the literal is a spread with no owns key, readOwns returns declares: true, entries: [], problem: null. The run then reports a clean headline for code that no oracle owns.

Each case below shows what readOwns returns, as declares / entries / problem:

  • const opts = { owns: ['src/x.ts#a'] }; oracleProperty(opts) gives true / [] / null.
  • const base = { owns: [...] }; oracleProperty({ ...base, id: 'x' }) gives true / [] / null.

The other indirect forms already refuse: owns: OWNS, { owns }, a spread array, as const, satisfies, a parenthesized array, and a ${} template.

End to end, with a spread base in the ws-b repro: "4 mutants, 2 killed, 0 gaps, 2 unowned (warnings)", then "done completed, 0 gaps". The author sees a clean headline, and the oracle has judged nothing. That's worse than the forms that refuse.

Authority. P8 in the decisions register says an unknown source is never silent. P6 says ownership is read from the owns entries on oracleProperty.

Proposal.

  • When the options of an oracleProperty call aren't an object literal, or the literal has a spread and no own owns key, refuse with the same problem as the constant case: "its owns list is not written in the oracleProperty call, so the gap report cannot read what it owns". Include a fix line.
  • Add a matching eslint-plugin-oracles rule, so the problem shows up at lint time.
  • In the oracle, add generated owns forms (inline, constant, spread base, options variable) to the owners oracle. Each form must either be read correctly or refused, never read as empty.

This issue was written by Isaac.

Lenguaje dominante
JavaScript
Estrellas
5
Forks
1
Merge medio
8 h 31 min
PR fusionados (30 d)
60

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 TanStack/oracles

Todos los issues de TanStack/oracles

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.