oracle-gaps: a mutant's outcome can depend on its batch (setup-error in a full run, killed with --only)

未關閉
#53 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
18/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
javascript, node.js
領域
testing

研究方向

Start with capture-setup.mjs, which resets the module registry and deletes new globals between copies but does not restore existing builtin prototypes. The report IDs in the issue (2026-11-12T23-35-42-301Z-3e2c4991 and the --only replay 2026-11-12T23-37-41-738Z-d866fd67) show the same mutants changing outcome with batch composition. Done means a deterministic witness in which one mutant's outcome depends on an earlier mutant in the same worker, and a fix that makes --only and full runs agree. Expect to ask the maintainers how to pin batch order first.

由索引模型根據 Issue 內容生成。

描述

Summary

In one onboarding run (klona, r20), two mutants were reported as setup-error in a full gap check, but a replay with --only killed both of them. A mutant's outcome must not depend on what else is in its batch: --only must give the result that the full run gives.

Evidence (unverified, from the r20 session)

  • Repository: /tmp/oracle-validation/r20/codex-klona/repo. The notes are in oracles-feedback.md, beside the run log.
  • Full run report 2026-11-12T23-35-42-301Z-3e2c4991: JSON mutants M21 and M22 were setup-error, with Spread syntax requires ...iterable[Symbol.iterator] to be a function. Production was unchanged and every baseline test passed.
  • An isolated replay right afterwards, --only json.js:M21,json.js:M22 (report 2026-11-12T23-37-41-738Z-d866fd67), killed both under the law array slots.
  • A full replay with the fork pool reproduced the setup errors (report 2026-11-12T23-38-22-238Z-fd6a91f0), so worker isolation did not change the result.
  • In two later complete runs, the discrepancy did not recur.

Hypothesis (not confirmed)

The cause is global state carried from one copy to the next. Each copy resets its module registry and deletes the global names that the worker did not have at first (capture-setup.mjs). It does not undo changes to existing builtins, such as a property written on Array.prototype or Object.prototype. Klona's pollution-safety laws show that its mutants can write there. A polluting mutant that runs earlier in the same worker would then break a later copy's module load or setup (...iterable[Symbol.iterator]), which is reported as a setup-error that --only does not reproduce.

This is a different mechanism from the copy-path seed defect fixed in the follow-up PR for #48 (each copy seeded Math.random by its copy path). That defect affected every copy, so --only would show it too.

What a fix needs

  • A witness in which a mutant's outcome changes with batch composition. It needs two mutants in one worker, in a known order, with the first writing to a builtin prototype. The runner's scheduling does not fix that order today, so a deterministic witness may need a way to pin a batch.
  • Then, possibly: snapshot and restore builtin prototypes between copies, or run each copy that writes to them in a fresh worker.
主要語言
JavaScript
星號
5
分支
1
平均合併
8 小時 31 分鐘
30 天內合併 PR
60

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

TanStack/oracles 的其他 Issue

查看 TanStack/oracles 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。