Caretaker Express · PostgreSQL · Cedar

Verification

How this course was verified

This page states what was checked, how, and what was not checked. It was written after the final full replay; the per-lesson table below is generated from that replay's report.

Summary

Check Result
Full replay of all 50 lessons, in order, from an empty directory all 50 lessons replayed without a failure (finished 2026-11-28T13:33:51.671Z)
Tests at the end of the course (reference implementation) 137 tests, 137 passing, 0 failing (npm test at the end of lesson 10.5)
Lessons whose end-of-lesson npm test passed 43 of 43 lessons that have a test suite (lessons before 1.5 have none)
Strict building build (every check block has a current recorded output; every screenshot exists; every lesson has the eight required sections) passed with 0 problems
Run from a fresh git clone with an empty database (lesson 10.3, executed by the replay) migrate, seed, npm run check (131 tests) and a real page request all succeeded
Explorer data exported from the final reference app after db:reset (22 entities, 15 policies, a 12-step trace of a real GET /issues/101)

How the course is verified

The lessons are the single source of truth. A replay tool (course/tools/replay.mjs) reads the lessons in order and, in an empty directory, does what a learner does:

  • creates every file shown as Create file or Replace whole file, and applies every Edit as an exact find-and-replace (a hunk that does not match exactly once stops the replay);
  • runs every Run and Run and compare command, and checks the exit code and, where the lesson states one, an expected pattern in the output;
  • starts the dev server where the lesson does, restarts it when files change (as node --watch does), and records server log excerpts;
  • runs SQL blocks in psql inside the Docker container;
  • takes screenshots in Google Chrome through playwright-core, logging in through the real login form where a user is named;
  • runs npm test at the end of each lesson (or reuses the lesson's own final run), then commits and tags lesson/<id>.

Every output shown on the building (terminal output, psql results, server logs, screenshots) comes from that run. The building builder refuses, in strict mode, to publish a lesson whose recorded output is missing or older than the lesson text.

Output normalization, applied to recorded text only: the replay's absolute paths become /Users/you/code/caretaker, the home directory becomes /Users/you, and ANSI colour codes are removed. curl runs with --no-progress-meter through a .curlrc (curl hides its progress meter in a terminal; the replay is not a terminal). Docker Compose prints plain progress lines when its output is not a terminal; the course says so in lesson 0.1. Times, durations, IDs of new rows, cookies and request IDs are real and differ between runs.

Environment of the final run

macOS 26.7.2 (darwin-arm64), Node.js 22.23.1, npm 10.9.8, Git 2.54.0, Docker version 29.9.3, build 5457199, Google Chrome 158 (screenshots).

The reference application pins: Express 5.3.0, EJS 7.0.2, pg 8.23.1, express-session 1.19.0, connect-pg-simple 10.0.0, argon2 0.45.2, express-rate-limit 8.7.4, @cedar-policy/cedar-wasm 4.14.0 (Cedar language 4.6), Supertest 7.3.2, PostgreSQL image postgres:18.7-alpine. @cedar-policy/cedar-wasm@4.14.1 was found to be a broken publish (2 files, about 6 kB) and is avoided; lesson 6.1 shows the check.

Behaviour verified by the reference implementation's tests

The 137 tests at the end of the course (131 before the capstone) cover, among others:

  • the complete access matrix from lesson 5.1, one row per request and every user, kept green from Module 5 (plain JavaScript) through Modules 6 to 10 (Cedar);
  • list parity: for 6 users × 30 issues and 6 users × 4 inspections, the SQL list contains exactly what Cedar allows;
  • tenant isolation: 95 attacks with foreign identifiers by three outsiders and one insider, each refused, with an MD5 fingerprint of ten tables unchanged;
  • revocation taking effect on the next request with the same session;
  • forged headers, query strings and form fields (roles, user IDs, building IDs, reporter, organisation) having no effect;
  • unauthorized grant attempts (self-changes, building_admin by a building admin), separation of duties, and the capstone's self-assignment forbid;
  • the four decision outcomes: allow, explicit deny (forbid), implicit deny, failure; the policy store validates against the schema;
  • authentication: argon2id hashing, session regeneration at login, cookie attributes, CSRF tokens on every POST form, login throttling, security headers.

Website checks

Run against the built building (npm run serve) in the app's browser pane and in Google Chrome through playwright-core:

  • node tools/check-building.mjs (npm run check in course/) opened all 107 pages in Chrome (landing page, course map, verification page, 50 lessons, 47 checkpoint pages, the explorer index and six explorer pages) and found no page errors, no console errors and no broken internal links among 147 checked;
  • the five real-engine explorers load Cedar 4.14.0 (WebAssembly) and evaluate with the exported data: the playground presets give the expected decisions (allow by building-read; deny by forbid-self-approval); the request trace re-runs the recorded call live and matches the recorded decision; the role-explosion explorer is labelled as a counting model;
  • copy buttons copy the exact block text (checked in Chrome with clipboard permission: clipboard content equal to the source). The app's own browser pane blocks clipboard access; the button then says "Press Ctrl+C";
  • keyboard: / opens search, typing and Enter open the matching lesson section, [ and ] move between lessons, m marks a lesson complete, t changes the theme, ? opens the shortcut list, Escape closes dialogs;
  • progress: marking complete persists across reloads (localStorage); the landing page offers "Resume lesson …" for the last lesson opened;
  • light, dark and system themes switch, including the diagrams; at 375 px wide the lesson page has no horizontal scroll and the navigation becomes a drawer;
  • with prefers-reduced-motion: reduce, transitions in the explorers are disabled;
  • the capstone solution is closed behind a disclosure, and its text is excluded from search.

Not verified, and known limitations

  • Platforms. Everything was run on macOS (arm64) with Docker Desktop. The Windows (WSL 2) and Linux notes in the lessons were written from documentation and were not executed.
  • Node.js 24. The course supports Node 22 and 24 LTS; only Node 22.23.1 was used.
  • Screen readers. Keyboard operation and labels were checked; no screen-reader session was performed.
  • Explorer keyboard focus. The explorer agent verified hover and click on chips; focus issues could not be exercised while the browser pane was in the background.
  • Effort estimates are computed from the amount of text, code and commands in each lesson, not measured with learners.
  • Security scope. Caretaker is learning-grade: lesson 10.3 lists what production would need (separate database users, secrets management, HTTPS, MFA and password reset, shared rate-limit store, session invalidation on password change, backups, monitoring). Row-level security is demonstrated in psql, not wired into the app.
  • Optional decision service (lesson 9.2) is tested with Supertest and curl; the app itself keeps its in-process engine.

Per-lesson replay results

Replay environment: darwin-arm64, Node v22.23.1, Docker version 29.9.3, build 5457199. Finished 2026-11-28T13:33:51.671Z.

LessonTitleReplayTests at lesson endCommit
0.1What we are building✓ replayed––
0.2Install and verify your tools✓ replayed––
0.3Terminal, folders and environment variables✓ replayed––
1.1npm init and a first Express server✓ replayed–d2d3f13
1.2Routes, requests and responses✓ replayed–e753e00
1.3Middleware, JSON bodies and errors✓ replayed–08e58c4
1.4HTML pages with EJS✓ replayed–5921b20
1.5First tests, and the limits of memory✓ replayed✓ tests 7, pass 7, fail 0e7329af
2.1PostgreSQL with Docker Compose✓ replayed✓ tests 7, pass 7, fail 0b1c4cd3
2.2Tables, keys and constraints✓ replayed✓ tests 7, pass 7, fail 0da42290
2.3Migrations you can run twice✓ replayed✓ tests 7, pass 7, fail 0af48e24
2.4Seed data and reading it with SQL✓ replayed✓ tests 7, pass 7, fail 0c9ee520
2.5Connect Express to PostgreSQL✓ replayed✓ tests 5, pass 5, fail 06eba359
2.6Safe writes and a test database✓ replayed✓ tests 7, pass 7, fail 0a09f004
3.1Routers, and organisations you can create and edit✓ replayed✓ tests 12, pass 12, fail 0af6edac
3.2Buildings, unique names and safe deletes✓ replayed✓ tests 18, pass 18, fail 06669662
3.3Edit, move and delete issues✓ replayed✓ tests 22, pass 22, fail 06c2da1f
3.4Paging, sorting and filtering✓ replayed✓ tests 27, pass 27, fail 01d53be5
3.5Inspections, a state machine and transactions✓ replayed✓ tests 33, pass 33, fail 07274ad2
3.6A dashboard, and the CRUD app as a whole✓ replayed✓ tests 35, pass 35, fail 0ec77da9
4.1Users and password hashing✓ replayed✓ tests 35, pass 35, fail 0673bacd
4.2Registration, login and sessions✓ replayed✓ tests 40, pass 40, fail 016fa1df
4.3Require login, and keep sessions safe✓ replayed✓ tests 47, pass 47, fail 0edfb94c
4.4CSRF tokens, login throttling, and "logged in" is not "allowed"✓ replayed✓ tests 52, pass 52, fail 02510736
5.1Memberships, building roles and the access matrix✓ replayed✓ tests 56, pass 56, fail 06fb95d8
5.2Authorizing issues in plain JavaScript✓ replayed✓ tests 64, pass 64, fail 0886a78f
5.3Lists and tenant isolation✓ replayed✓ tests 69, pass 69, fail 0bbf92aa
5.4Buildings, organisations and inspections✓ replayed✓ tests 77, pass 77, fail 0847472a
5.5Role explosion and the access matrix as a test✓ replayed✓ tests 88, pass 88, fail 0c51c4d8
6.1The first Cedar decision✓ replayed✓ tests 88, pass 88, fail 044c8e7c
6.2A schema, and policies that are checked before they run✓ replayed✓ tests 89, pass 89, fail 029492d0
6.3From database rows to Cedar entities✓ replayed✓ tests 90, pass 90, fail 09410fba
6.4Cedar behind can(): the first route✓ replayed✓ tests 89, pass 89, fail 05379594
6.5Every route on Cedar✓ replayed✓ tests 90, pass 90, fail 087c32bb
6.6Forbid, precedence, errors and failures✓ replayed✓ tests 95, pass 95, fail 021024d6
7.1Facts, parents and action groups✓ replayed✓ tests 95, pass 95, fail 0e6dd730
7.2Policy templates, compared✓ replayed✓ tests 95, pass 95, fail 049ec0a8
7.3Members and controlled onboarding✓ replayed✓ tests 101, pass 101, fail 063bd3e9
7.4Grant and revoke building roles✓ replayed✓ tests 109, pass 109, fail 0db0c522
8.1Lists and policies, kept aligned✓ replayed✓ tests 111, pass 111, fail 0292038b
8.2Creates and moves✓ replayed✓ tests 116, pass 116, fail 0c3227ac
8.3An isolation test suite✓ replayed✓ tests 120, pass 120, fail 020db85d
9.1Forged input, and what Cedar cannot know✓ replayed✓ tests 124, pass 124, fail 0543085a
9.2PDP, PIP, PEP and PAP, and a separate decision service✓ replayed✓ tests 128, pass 128, fail 0fbfcd34
9.3Defence in depth, stale data and races✓ replayed✓ tests 128, pass 128, fail 0fbfcd34
10.1Hardening, logging and configuration✓ replayed✓ tests 131, pass 131, fail 06ba0ab4
10.2The whole application, as six users✓ replayed✓ tests 131, pass 131, fail 06ba0ab4
10.3From a clean checkout, and what production needs✓ replayed✓ tests 131, pass 131, fail 085a65bd
10.4Recap, and your capstone feature✓ replayed✓ tests 131, pass 131, fail 085a65bd
10.5Capstone solution: work orders✓ replayed✓ tests 137, pass 137, fail 0eaa3738