~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

Split the spec, harness and server by area

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/monolith:split

The spec, harness and server, split by area, so that later slices (accounts, then sessions, blobs, identity, sync) can each be built by its own agent in its own files. Nothing a client sees changes.

Spec. SLICE.md becomes:

  • PDS.md, the entry: environment, methods, the general check order, how it's checked, the test vectors;
  • REPO.md, SYNC.md and DURABILITY.md beside it.

The text moves as it was, apart from short intros and links so each page stands alone.

Harness. compare.mjs drops from 1,404 lines to 76: the run and a weighted list of steps.

  • lib/ holds the plumbing: processes, xrpc, calls through tools and commands, state, reports, the random source.
  • checks/ holds one module per area: records, session, odd requests, repository, firehose, commands, crashes.

Server. pds-server/src/lib.rs drops from 909 lines to 344: the router, the shared state, and an AREAS table that dispatches to server.rs, repo.rs and sync.rs. log.rs holds the log and its durability tests, and each area's tests moved with it.

A new area adds spec/<AREA>.md, harness/checks/<area>.mjs and crates/pds-server/src/<area>.rs. It touches one line each in the PDS.md page table and method list, in compare.mjs's imports and steps, and in lib.rs's mod list and AREAS.

Proved identical. I recorded harness output before the split, then compared after splitting the harness and again after splitting the server:

  • plain seeds 1–3;
  • --commands seed 31;
  • crash runs: seed 21 with the firehose, 41 with the firehose and commands, and 22.

Commit races and kills make plain runs vary even on the old code. So the comparison used a preload outside the repo that sends requests one at a time in issue order, and logs each one. Old and new code gave identical output and identical request traces, apart from restart timings.

Checked: just gates: all 15 runs, the crate tests and conformance pass.

🤖 Generated with Claude Code

Approved

This splits SLICE.md into PDS.md, REPO.md, SYNC.md and DURABILITY.md, splits the server into server.rs, repo.rs, sync.rs and log.rs, and splits the harness into lib/ and checks/. I read the spec pages, AGENTS.md, the README, review.md, events.rs, lib.rs, server.rs, repo.rs, sync.rs and log.rs. I did not read the harness/ changes: compare.mjs and the files in harness/lib/ and harness/checks/. Their diffs were too large to read in this session. For them I rely on your before-and-after record of seeds 1–3, --commands, and the crash runs, so the harness is not independently reviewed.

  • Spec: Every rule from SLICE.md is in exactly one new page. The reference-behaviour bullets are split by area, and getRepo/getLatestCommit RepoNotFound moved to SYNC.md. The firehose and durability text moved unchanged. The README and COMMANDS.md links are updated, and the README says what is built, not how.
  • Server: The moved handler bodies are identical to the old ones. The AREAS dispatch keeps the old order: the owner's token is checked first for exactly the four repo writes. createSession stays unauthenticated, and unknown methods still return 501. The tests moved with their area and still check the same things. No crates were added and nothing was taken from the reference PDS or an SDK.
  • Conformance: conformance.yaml is untouched.
Merged as 9d2ff55