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

オープン
#75 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
eslint, javascript

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
JavaScript
スター
5
フォーク
1
平均マージ
8時間 31分
マージ済み PR(30日)
60

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TanStack/oracles のほかの issue

TanStack/oracles の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。