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

Aperta
#141 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
46/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, node.js
Ambito
devtools, testing

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
JavaScript
Stelle
5
Fork
1
Merge medio
8h 31m
PR unite (30g)
60

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TanStack/oracles

Tutte le issue di TanStack/oracles

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.