Part 0 · 1 chapters · ~8 min

The Method, and the Repos

How every module is built: the real system's contract, its core mechanism, the smallest correct version, edge-case tests, real tools as clients, and the list of what was left out; with the ten repos, their sizes, tests and the edges each gets right.

1

How this course works

ten systems, one method
  1. The contract the real system promises.
  2. The core mechanism that delivers it.
  3. The smallest correct version: narrow, and right.
  4. Edge-case tests, because that is where the bugs live.
  5. Real tools as clients: redis-cli, curl, nc, a browser.
  6. What was left out, which becomes the exercises.
partsystemrepolinesteststhe edge it gets right
M1Redisrepos/redis~4004a command split across TCP reads; TTLs that survive an AOF replay
M2Kafkarepos/kafka~3504a torn segment tail on recovery; the HW over the ISR only
M3compilerrepos/compiler~5506left associativity; short-circuit codegen; positioned type errors
M4transpilerrepos/transpiler~3507lexical this in arrows; nested templates; VLQ maps
M5JS frameworkrepos/jsframework~3005conditional dependencies; keyed rows keeping their input state
M6UI frameworkrepos/uiframework~3505batched updates; moves instead of re-creates; effect cleanup order
M7bundlerrepos/bundler~3002imports inside strings; shared modules staying in the main chunk
M8kernel slicerepos/kernel~2504priority preemption in MLFQ; swap-in as blocking I/O
M9storage enginerepos/storage~4505CRC-detected torn WAL tail; newest-wins merge with tombstones
M10HTTP serverrepos/http~3006pipelined responses in order; traversal refused; 431 limits
code
# every repo: Node 23.6+ runs the .ts files directly (type stripping), no install step
cd modules/byo/repos/redis
npm test                  # node --test test/*.test.ts
npm start                 # where a repo has a server or a demo

# all ten at once
cd modules/byo/repos && for d in */; do (cd "$d" && npm test --silent); done
how to read a repo
Read the README table first, then the test file, which is the specification in executable form, then the source in the order the README lists it. Break something on purpose (remove the CRC check, make the parser assume whole commands, drop the MLFQ preemption) and watch which test fails. That is the fastest way to understand why each line is there.
THE METHOD: SMALLEST CORRECT VERSION
how every module in this course is built, from the real system's contract to a tested core and a list of what was left out
swipe the figure sideways, or tap expand for full screen
1/6
contract
The contract: what the real system promises its users. Redis: a RESP protocol and single-threaded atomic commands. Kafka: ordered, durable, replayable partitions. A bundler: the same program behaviour in fewer, smaller files. Start from the promise, not the features list.