Skip to content

effects: an in-memory file store for deterministic simulation (specs/effects/sim_fs.t27) #9012

Open

Description

@gHashTag

Part of epic #9008 (effects at the edge); deterministic simulation primitives for #9002. Write it in t27 only. DRY rule (AGENTS.md, see #8963): first search for an existing implementation with t27c dupes --name <fn> and grep -rn over specs/. If one exists, use it and extend it instead of writing a copy. No hand-written code in other languages (see #8236).

Requirements

  • FR-001: specs/effects/sim_fs.t27 defines a fixed-capacity in-memory store that maps a path (bytes) to contents (bytes), with these operations:
    • write(store, path, data) -> bool: creates or overwrites, and returns false when the store is full;
    • read(store, path) -> ?[]const u8: returns null for a missing path;
    • remove(store, path) -> bool;
    • count(store) -> u32.
  • FR-002: A test named write_then_read_roundtrip writes two files, reads them back byte for byte, overwrites one, and reads the new contents.
  • FR-003: A test named missing_and_removed_read_null asserts that read returns null for a path never written and for a removed path, and that count follows the operations.
  • FR-004: Do NOT edit docs/reports/t27b_expectations.json or .trinity/seals/: they are shared hot files, and listing them made the Queen skip this issue as a file conflict. The steward adds the ledger row and re-saves the seal when the PR merges.

Success Criteria

  • t27c spec-status specs/effects/sim_fs.t27 prints IMPLEMENTED
  • grep -c 'test "write_then_read_roundtrip"' specs/effects/sim_fs.t27 prints 1
  • grep -c 'test "missing_and_removed_read_null"' specs/effects/sim_fs.t27 prints 1

Boundary

  • specs/effects/sim_fs.t27

User Scenarios

  • Given an empty in-memory file store, when a file is written and then read, then the read returns the exact bytes written.
  • Given a file store with two files, when one file is overwritten, then reading it returns the new contents.
  • Given a file store, when reading a path never written or a removed path, then read returns null and count reflects the current number of files.

Activity

  1. tri-claw commented on Oct 11, 2026

    @tri-claw

    The Queen cannot take this issue yet. A bee starts only on an issue whose body has every section below, and this one lacks:

    • missing: ## Success Criteria -- an outcome a machine can settle: a number with a unit, a backticked file, exit 0, or a backticked command

    She tried to write them 2 times and could not (last: refused: still missing: ## Success Criteria). Add them and the next round takes it. The rule is specs/policy/issue_shape.t27.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions