Decision
Recovery runs analysis, redo, undo. Analysis reads the last checkpoint LSN from checkpoint.meta (a fuzzy checkpoint of the active-transaction and dirty page tables, written via temp file and rename) and rebuilds both tables. Redo starts at the smallest recLSN and applies a record only if page.pageLsn < record.lsn. Undo follows each loser's prevLsn chain backwards, deleting inserted rows and restoring the before-image of deleted or updated ones, then appends an ABORT record. No CLRs are written; a code comment says they are 'intentionally' skipped and the README says 'for educational simplicity'. The LSN is the byte offset of the record in wal.log (LogManager.append), so undo can read any record by seeking to its LSN.
What happened
benchmarks/crash_recovery.ts (10,000 committed inserts, 500 uncommitted deletes, crash, recover twice) ends with 10,000 rows, and three crash-matrix tests plus two CrashRecovery unit tests pass. Undo progress is not logged: pages touched by undo get pageLsn = the current log tail, and only an ABORT record marks a loser as finished. Two gaps found in the audit: (1) recovery ends by writing a checkpoint that lists no active transactions; when a copy of the benchmark crashed again right after the first recovery, before pages were flushed, the second recovery found no loser, redid the 500 deletes and ended with 9,500 rows. (2) TxnManager.abort() (commit 8622bae) has a TODO for undo and only writes ABORT and releases locks, so a runtime abort rolls nothing back: an aborted insert and delete both stayed applied, before and after restart.
How this was checked: Read CrashRecovery.ts, LogManager.ts, CheckpointManager.ts, TxnManager.ts and the crash tests; ran benchmarks/crash_recovery.ts and the full suite; wrote a script (decisions/minidb_experiments/zz_exp_abort.ts) that inserts and deletes inside a transaction, calls abort(), and selects: the aborted insert stayed and the aborted delete stayed applied, before and after a restart. Attribution: All cited commits are authored by Ujjwaljain16 (git shortlog: 21 commits, one author). The README lists a two-person team, and git history cannot show which parts each person wrote, so the record should say "commits by Ujjwaljain16; two-person course project". No Co-Authored-By trailers exist in the history; whether AI tools were used cannot be determined from the repository. Comments in CrashRecovery.ts are written as running first-person reasoning, which is consistent with, but not proof of, AI-assisted coding.
Recorded at the time (a document or commit message states it) · reasons are stated in the repository · commit 7b7c4ce (first non-stub CrashRecovery.ts, LogManager.ts, CheckpointManager.ts)