Skip to content

daemon inputs: appends, partial and failed writes hide a file's earlier content; the runner-file rule matches users' paths #154

Open

Description

@KyleAMathews

Findings (review of #133, F9 and F10; both plausible, LOW).

F9. An append, a partial write, or a failed write hides a file's earlier content.

  • inputs.mjs counts appendFile* as a write and records the write before the call.
  • So in these cases the rest of the file is an input that is never recorded:
    • a test appends to a fixture that already exists, then reads it;
    • a test writes with { flag: 'r+' };
    • a test catches a failed write (to a read-only file), then reads the existing file.
  • Plan:
    • Record a read first for an append and for r+.
    • Record the write only after the call succeeds; for the async forms, when its promise or callback resolves.
    • The same applies to daemon inputs: reads through a file descriptor (open, read, FileHandle) are no input yet #141's open-flag rule (a keeps the earlier content, so it is a read too).
    • Oracle: a gate kind appendGate, in which file b appends to tests/gate.json and parses the whole file. The edit changes the part that was already there.

F10. The runner-file rule matches users' paths.

  • /\/\.oracle-gaps-\d+[-/]/ also matches a user's file named .oracle-gaps-<digits>-….
  • The fix matches the session's real pid and home, which the CLI already knows and can pass to the harness through inject.

Authority: R46, G42, I8 (v21.2), and M 2026-11-17 "Own writes aren't inputs", whose scope is the writer's own output only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions