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

Aberta
#75 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
45/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
eslint, javascript
Domínio
testing-qa, tooling

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
JavaScript
Estrelas
5
Forks
1
Merge médio
8h 31min
PRs com merge (30d)
60

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TanStack/oracles

Todas as issues de TanStack/oracles

Issues semelhantes

Mais issues de JavaScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.