daemon inputs: reads through a file descriptor (open, read, FileHandle) are no input yet

未关闭
#141 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
46/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
领域
devtools, testing

调研方向

Read packages/oracles/oracle-gaps/inputs.mjs, especially watchReads, and compare the existing filesystem input wrappers added for #133. Start by adding the fd gate history to the oracle and shard lists, then run the specified fixed-seed Vitest command to confirm the regression. Done means the new history fails before the wrapper change, passes on shard 4 afterward, and its mutant fails only that history.

由索引模型根据 Issue 内容生成。

描述

Family: reads through a file descriptor. fs.openSync/fs.open/fs.promises.open, followed by readSync/read/readv/fstat, FileHandle.read/readFile/stat, or readFileSync(fd), reads a file without naming its path in the read. None of these reads is an input today. The README lists them.

Gate kind fd: file b opens tests/gate.json with openSync, reads it with readSync into a buffer, closes it, and parses the text. A second history, fdPromise, can use fs.promises.open and handle.readFile().

Fix: wrap openSync, open and fs.promises.open. An open with a reading flag (r, r+, a+, w+, or the default) records fs:<path>, hashed by the whole file, so every later fd read of it is covered (sound over-approximation). An open with only a writing flag (w, a, wx) records a write, which joins #133's own-writes rule (ratified M 2026-11-17). The fd argument forms of readFileSync and readFile need no key of their own: the open already named the path. Inherited fds (stdin, a pipe) have no path and are a stated limit.

Authority: maintainer decision M 2026-11-16 "Every read is a daemon input" (the user ruled it with no exceptions), v21.2 R46, G42, I8. The watch family (watch, watchFile) stays no input (C-19).

Context: #133 records the six #55 fs calls on any path, node_modules included, plus environment variables, plugin inputs and directory listings (readdir/opendir, dir:/dirs: keys). The recorder is packages/oracles/oracle-gaps/inputs.mjs (watchReads), shared by the worker (capture-setup.mjs) and the CLI process (check.mjs). Keys are hashed by inputHash and looked up through servedHash. This family is still unbuilt, so I8 does not hold for it.

Oracle-first plan (the pattern from #133):

  1. Add a value to inputRead (drawn, appended; update the canary's inputRead line) and one constructed history appended at the end, with steps [inputGate, recheck]. It enters edit inputGate changed the cold result, an edit to the <kind> gate input changed the cold result and an unchanged check through the daemon computed nothing. Add it to scripts/pr-shards.mjs shard 4 (and a Windows shard) and to scripts/e2e-shards.mjs.
  2. RED: run pnpm exec vitest --run --config oracle-gaps/vitest.config.mjs gap-report-oracle -t "fixed seed 20261105: <name>" on the oracle-only commit. Expect incremental equals cold: "after inputGate, the daemon's report differs from the cold run's", with the daemon reusing killed where the cold run says survived.
  3. Fix in inputs.mjs (see below), then show GREEN on shard 4.
  4. Mutant: remove the new wrapper or key from watchReads. Only this history should fail.
主要语言
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 摘要。