Add property tests, an old-database test and a live lookup check

The queue test runs random sequences of enqueue, look up again, cancel,
failure, time and restart. It found a book left pending for ever when
Look up again landed on a book already queued for its weekly re-check;
that lookup now counts as a real one.

Also: the three-frame camera rule against an independent model, a
pre-looked_up_at database opening intact, a script that checks nine
books against the live catalogues, and the sisi contract naming them.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-22 19:55:31 -07:00
1 parent a08fbff685
commit 3208d4f19c
6 files changed
+696 -1

No files matched your search

+2 -1
View File
@@ -170,7 +170,8 @@ export function createJobs(deps: {
async function attempt(id: number): Promise<void> {
const book = db.getBook(id);
if (!book || (book.status !== 'pending' && !rechecks.has(id))) { forget(id); return; }
const recheck = rechecks.has(id);
// A book that was made pending meanwhile ("Look up again") is a real lookup, not a recheck: it must end resolved or needs-attention.
const recheck = rechecks.has(id) && book.status !== 'pending';
const n = attempts.get(id) ?? 0;
const input: ResolveInput = {};
if (book.isbn13) input.isbn13 = book.isbn13;