daemon inputs: link targets and the rest of the stat family (lstat, readlink, realpath, access) are no input yet

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
领域
testing, tooling

调研方向

Start with packages/oracles/oracle-gaps/inputs.mjs and trace watchReads, inputHash, and servedHash; then read the oracle history and shard definitions in scripts/pr-shards.mjs and scripts/e2e-shards.mjs. Add the link and stat family as oracle histories first, following the listed RED, fix, GREEN, and mutant steps. Done means the new history fails against the current daemon, passes on shard 4 after the fix, and its mutant fails only that history.

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

描述

Family: link targets and the stat family. lstat/lstatSync/fs.promises.lstat, readlink/readlinkSync/fs.promises.readlink, realpath/realpathSync/fs.promises.realpath, access/accessSync/fs.promises.access, the callback stat, and exists are not inputs. G42 says the stat family records existence, kind and link target. Today statSync, existsSync and promise stat key a path as fs:, by the file's text, not a file, or missing. Nothing records a link's target.

Gate kind link: tests/gate-link is a symbolic link to open or shut, two files with the same text. File b reads readlinkSync(new URL('./gate-link', import.meta.url)) and opens the gate when the target is open. The edit re-points the link, so no file's text changes. A second history, lstat, can test lstatSync(...).isSymbolicLink() against a link that the edit replaces with a file. writeFixture already writes links ({ link }).

Fix: a key link:<path>, hashed by the kind from lstat plus readlink's target, or missing. Wrap lstat* and readlink* to record it, and realpath* to record link: for each component (or the resolved path's fs:). Wrap access*, the callback stat and exists to record fs: (existence and kind). Add link: to inputHash and servedHash.

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 摘要。