Skip to content

benchd M0 — the skeleton: cargo workspace, BENCH_SUITE isolation, socket, event log, CLI exit codes, and its own gate #338

Description

@Wirasm

First milestone of the bench build. Read docs/bench-roadmap.md before anything else — it is written for a session with no prior context, and its invariants section is binding. Rationale and decisions live in docs/workbench-audit-2026-08.md. The name bench/benchd is settled (roadmap, naming note); do not reopen it.

Scope — one complete, green, provable M0 slice

  • daemon/ cargo workspace at the repo root, per the tree in the roadmap's M0 section (decided, not up for redesign): crates benchd, bench, bench-wire under daemon/crates/. No root Cargo.toml — cargo invoked at the repo root must fail loudly, not half-work.
  • BENCH_SUITE=<name> isolation from day one: socket path, record directory, and all state move together; refusals are loud (port the semantics of helm's HELM_DEFAULTS_SUITE / DefaultsSuite, including refusing rather than silently falling back to the live instance). Unset = the canonical paths.
  • benchd binds a Unix socket at the suite-aware path; bench talks to it.
  • Append-only event log (JSONL) and the record layout under ~/.bench/ (suite-aware).
  • bench CLI skeleton: --suite, and the exit-code discipline ported from the spool scripts — 0 ok, 2 no daemon, 3 refused (with a reason on stderr), 4 daemon accepted and failed.
  • Port helm's request-id newtype rule into bench-wire (helm landed it as The spool request id is a bare String, and the gate that makes it a filename is asked at two of six sites #260 — port, don't reinvent: an ungated id must be unrepresentable at any path builder).
  • daemon/AGENTS.md: the gate command, conventions, and a pointer to the roadmap's invariants.
  • daemon/test.sh gate: cargo fmt --check, clippy, cargo test, plus a conformance harness that runs the real bench binary as a subprocess and checks both directions (the SpoolWireConformanceTests shape — stand up the pattern now, even while the surface is small).
  • CI: a separate job triggered on daemon/** changes. The Swift gate must keep needing only the Swift toolchain.

Prove

  • Two instances (live + a BENCH_SUITE instance) run side by side with zero shared state — and the negative control: the suite instance's state directories and socket never touch the canonical paths.
  • The conformance harness fails when an exit code or wire shape drifts (demonstrate once by breaking it, per the watch-it-fail rule).

Out of scope

Taps, attention queue, mail, spawning, ptys — all later milestones. Do not touch Sources/, hooks/, pi/, or tools/. Nothing is unwired in M0.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions