Skip to content

v2.8.2 - #1060

Merged
ajslater merged 541 commits into
mainfrom
develop
Nov 27, 2026
Merged

v2.8.2#1060
ajslater merged 541 commits into
mainfrom
develop

Conversation

@ajslater

@ajslater ajslater commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

🐛 Fixed

  • Previewing many reading lists at once no longer stops early, and shows its progress.

ajslater and others added 30 commits September 28, 2026 12:49
The dialog re-validates the form on every edit and set the submit button
from whichever async form.validate() settled last. It also validated
before the inputs re-rendered, so the check read each field's value from
before the edit: a group name entered in one input event was checked as
blank ("Name is required") and "Add Group" stayed disabled on a valid
form.

Wait a tick so the fields settle, and apply only the newest validation.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Anonymous browsing with Non-Users on logged "Authentication credentials
were not provided." on every load: the SPA sends the browser timezone
for kiosk sessions on purpose (app.vue's nonUsers watcher), but the
v4 cutover folded the v1.7 PUT /auth/timezone/ into PATCH /auth/profile,
whose IsAuthenticated policy 403s anonymous callers. The client was
right; the server regressed. CodexMiddleware activates the session
timezone on every request, anonymous or not, so the value is used.

Restore a dedicated PUT /api/v4/auth/timezone on the default
IsAuthenticatedOrEnabledNonUsers policy (what v1.7 used), point the
client at it, and drop timezone from the profile PATCH so there is one
write path. Relaxing ProfileView instead would have opened its GET and
username/email edits to anonymous callers.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The admin store's generic table engine (loadTable, loadTables, the row
writes and pending-delete revival) backs every admin tab, but the only
store specs covered OIDC and the site defaults. This adds a
characterization spec for it, with every TABLES request function mocked
and each table's real stateField kept.

It covers both response shapes loadTable accepts (a bare array and a
cursor page) and what happens to anything else, the 5 s sticky cache
per table, AgeRatingMetron never expiring, force bypassing the cache,
and loadTables filling each table's own field and resolving only when
all have landed.

It also pins which tables reload after a write: create, update and
delete force-reload only their own table, and a revive force-reloads
PendingDelete and Library, with nothing reloaded when the request
fails. The librarian-status diff keeps unchanged rows (and their
watchers) untouched, and non-staff visitors get no request and no
state change.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
_validateTopCollection has needed five fixes and no test reached it: the
existing pipeline specs enter through _validateSearch and never take its
top-collection branches. This spec drives the live store through each of
them, with every case named for the route it runs on.

It covers the root guard and its folders/arcs exception, the switches that
keep the route, the in-place redirect for a parent top collection (whose
numeric page is what keeps _validateAndSaveSettings' "already there" check
from dropping it), the root redirect for a child, the moves to and from
folders and arcs, and the case where no browser route exists yet.

getTopCollection's walk up the hierarchy is pinned against settings.show,
and lowestShownCollection against both browse and non-browse top
collections. No production code changes.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The browser store kept a top-level `zeroPad` that nothing reads; the
card subtitle reads the server's `page.zeroPad`. `deleteSavedSettings`
has had no caller since the saved-settings UI landed without a delete
button; the API function it wrapped stays for when one is added. The
misc settings drawer mapped `twentyFourHourTimeTitle`, which its
template never uses.

No behavior change.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…om to top (#943)

* refactor(reader): drop reader store bindings no component uses

Eight reader components mapped store members they never read. Two of
them pointed at nothing: the pager mapped an `isBookVertical` action the
store doesn't have, and the books window defined `bookChangePrev` and
`bookChangeNext` computeds that called an unmapped `bookChangeShow` and
would have thrown if anything had rendered them. The rest were real
members left behind by earlier moves: the top toolbar's four navigation
actions, the download panel's `routeParams`, `isBTT` in the book-change
drawer and nav button, and the horizontal pager's `nextBook` and
`setBookChangeFlag`.

The vertical pager only reads `reactWithScroll`, so it maps it with
`mapState` instead of `mapWritableState`.

No behavior change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(reader): make the "b" shortcut set bottom to top reading

The reader settings drawer's "b" key wrote the reading direction "bbt",
which isn't a direction the server accepts, so the shortcut never
switched a book to bottom to top. It now writes "btt".

A new spec presses each direction and fit key and checks the values
sent against the reader choices the server generates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…944)

* fix(reader): stop a redundant settings request and a stale zoom fit

Opening a book asked the server for the global reader settings twice.
loadBooks fetched them on its own behind a settingsLoaded flag that
nothing has set since the flag's setter was removed, and then
loadAllSettings fetched the global, series and comic settings for the
same book. Every book open made the extra request. loadBooks now relies
on loadAllSettings for the global settings, and the dead flag is gone.
The reader view still loads the global settings on its own before a
book arrives.

loadAllSettings now also marks the global settings as loaded when they
arrive. The dropped request used to do that, and without it a site
default seed landing after the book's settings could overwrite the
stored global settings until the reader view's own load arrived.

Zooming a page with a double-click did not switch the page to its
original-size fit. The fit class is cached with each book's settings
and depends on the zoom level, but the zoom was the one reader setting
that did not drop that cache. A zoomed page kept its screen, width or
height fit and was magnified from the fitted size, off centre and
larger or smaller than the scroll area sized for it. The zoom now drops
the cache like every other settings change, so zooming in shows the
original size and resetting the zoom restores the chosen fit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(reader): pin how book settings are masked and cached

Cover getBookSettings: the book over the series over the global scope,
empty values never overriding a lower scope while false and 0 do, two
pages forced off in vertical reading, the direction flags for all four
directions, the fit class when zoomed, the per-book cache, and every
action that must drop that cache, zoom included. Also pin that opening
a book makes one settings request that includes the global scope, and
that the settings it loads stop a later site default seed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
)

The admin store's folder picker state used the key `root`, but the
server sends `rootFolder` and the picker reads `rootFolder`. Clearing
the Library path field reset the picker to `{ root, folders }`, so the
root folder read as empty until the follow-up folder load replaced the
whole object. The state and `clearFolders` now use `rootFolder`.

The libraries table also mapped a `clearErrors` action the admin store
doesn't have; that lives in the common store. It was never called, and
would have thrown if it had been.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ndles (#946)

The socket client lazy-imports the admin store so non-admins never
download it, but the metadata dialog's controls imported the online-tag
launcher statically, and the launcher imports the admin store. That put
the store in every browser and reader page load.

The controls now load the launcher with defineAsyncComponent, the same
way the metadata dialog already loads the tag edit panel. The launcher
only renders for admins, so only they fetch it.

Checked in the build manifest: the reader entry no longer reaches any
admin chunk, and the browser entry no longer reaches the admin store.
The browser still reaches the admin API client, which the card menu's
custom cover buttons import directly.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…948)

* test(admin): cover the table engine

The admin store's generic table engine (loadTable, loadTables, the row
writes and pending-delete revival) backs every admin tab, but the only
store specs covered OIDC and the site defaults. This adds a
characterization spec for it, with every TABLES request function mocked
and each table's real stateField kept.

It covers both response shapes loadTable accepts (a bare array and a
cursor page) and what happens to anything else, the 5 s sticky cache
per table, AgeRatingMetron never expiring, force bypassing the cache,
and loadTables filling each table's own field and resolving only when
all have landed.

It also pins which tables reload after a write: create, update and
delete force-reload only their own table, and a revive force-reloads
PendingDelete and Library, with nothing reloaded when the request
fails. The librarian-status diff keeps unchanged rows (and their
watchers) untouched, and non-staff visitors get no request and no
state change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(admin): share one sticky-cache test across the admin loads

The admin store's table loader and its six settings loaders each
repeated the same five-line check of a timestamp against the cache
window. They now call one isFresh helper, so the window's edges (a
never-loaded stamp is stale, and so is data exactly one window old) are
defined once.

No behavior change. A flat spec pins the helper. The table engine spec
and the OIDC and site defaults specs exercise three of the seven gates
through the store; the tagging defaults, tag-write errors, email and
throttle gates are the same one-line call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…950)

The browser card menu's Upload Cover and Remove Cover buttons imported
uploadCustomCover/removeCustomCover from @/api/v4/admin statically, so
the browser entry pulled the whole admin API chunk (~4.8 kB) on first
load for every user. Both buttons are admin-only (isUserAdmin gate,
AdminAPIView on the server), so load the client with a dynamic import
inside their handlers instead. The menu stays synchronous; the chunk is
fetched only when an admin actually uploads or removes a cover.

Adds unit tests for both buttons' admin flow and non-admin hiding.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
loadTable didn't check the order its responses came back in, and it
stamped each table when the response arrived. If a tab mounted with an
empty or expired cache, its read could still be in flight when the admin
saved a row. The save's forced reload landed the new rows, then the
older read landed late and put the pre-save rows back. It also restamped
the table, so every unforced read for the next five seconds was served
those stale rows from cache. A WebSocket-forced reload overlapping a
slower unforced read did the same thing.

Every loadTable call now takes a request number. Rows land only if no
later request for the same table has landed first. A later request that
fails doesn't block an earlier one. The table is stamped with the time
its request went out, because the rows are only as fresh as that moment.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
FIT_TO_CLASSES mapped "O" to "Original", so the Original Size setting
at the default zoom produced fitToOriginal / fitToOriginalTwo /
fitToOriginalVertical while page-img.vue and pdf-doc.vue only style
fitToOrig*. The zoomed-in path already used "Orig". Map "O" to "Orig"
and have the zoom path read the same entry so the two can't drift.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
None of pdf-doc.vue's four canvas rules had matched anything since the
Vuetify 3 port (Dec 2022). That port moved them from an unscoped block
into top-level :deep() selectors, which compile to
`[data-v-x] .vue-pdf-embed.X > div > canvas` and need a scoped ancestor.
The embed is the component's root, so it has none. vue-pdf-embed 2.x
also nests the canvas one div deeper than `> div > canvas`.

With the selectors fixed (`.pdfDoc.X :deep(canvas)`), each rule was
checked in a browser with Force vector at DPR 2:

- Fit to Height/Screen two-page `width: inherit` and Fit to Width
  two-page `height: inherit` did nothing. vue-pdf-embed already gives
  the canvas an aspect-correct inline size. Deleted.
- Original two-page `width/height: inherit` resolved to auto, so each
  canvas showed at its bitmap size, 2x on HiDPI (1023x1581 instead of
  512x790). Zoom uses these classes too. Deleted.
- Fit to Screen `object-fit: contain` did nothing, because the box
  already matched the bitmap. Kept, and paired with max-width
  100vw/50vw as page-img.vue does for images. Wide pages now fit the
  screen instead of overflowing it: a spread plus a page in two-page
  mode at 1024px went from a 1491px scroll width to 1024px, and a wide
  page on a 390px phone from 1092px to 390px.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…errors (#952)

loadTagWriteErrors had the race loadTable had before #949. The Tagging
tab and the settings button read the list unforced when they mount, and
the WebSocket forces a reload whenever it changes. If a slow mount read
landed after the forced reload, it put the older list back and stamped
it when it arrived, so every unforced read for the next 5 s was served
the stale list. clearTagWriteErrors wrote [] directly, so a read that
went out before the clear could put the cleared errors back the same way.

Both now use loadTable's request counter. #949's landing check moves into
a claimLanding(key, request) helper that all three share, keyed like
timestamps. The tag-write reads take a number when they go out, land only
if no later request has landed, and stamp the time they went out. The
clear takes a number when its DELETE goes out, so an older read can't
undo it, and a read that went out after it and already landed isn't
wiped by it.

The singleton settings loads (tagging defaults, email, OIDC, site
defaults, throttling) are unchanged. Nothing forces them, and their only
writer is the same tab's own Save. That can't realistically fire before
the tab's mount read comes back.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* chore: update devenv

- Retire the dead .circleci ignore lines (devenv's new retirement lists).
- eslint base config: presets apply again and Markdown code blocks are
  linted, which reformats the compose YAML example in docs/DOCKER.md.
- pyproject template: T201 exemption for bin/release_info.py.
- eslint-plugin-package-json bump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci: compose CI from devenv's building blocks

ci.yml is now a caller of devenv's CI building blocks (copied in by
`make update-devenv`) plus codex's own image jobs:

- ci: devenv-check.yml with ci-target codex-ci and the same four checks.
  Its gate runs the Release Preflight and, on a main push, reuses the
  python-dist of an earlier run that passed on the same git tree (keyed
  by tree hash, replacing the "last merged PR" lookup). One image job
  builds codex-ci and pushes it by digest; each check pulls it instead of
  building and loading its own. The required check becomes
  "CI / Lint, Test & Build Dist".
- build, deploy, deploy-hub: unchanged in substance, but they read
  deploy/version/final from ci's outputs instead of testing the event or
  grepping pyproject.toml. deploy publishes to PyPI through devenv-pypi
  (uv publish --check-url) after the manifest. deploy-hub now skips at the
  job level for alphas.
- release: devenv-release.yml (tag, GitHub Release, merge-back), after
  deploy and deploy-hub.

Removes .github/actions/ci-container (now devenv-ci-container) and the
release-engine tests, which devenv owns now; codex keeps its golden
NEWS.md tests. tests/test_ci_workflow.py pins how codex wires the blocks.
CLAUDE.md describes the new graph and the current Dockerfile stages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* update deps

* fix(make): build the choices JSON before lint and fix

Since the ESLint preset fix (#931, #932), import-x/no-unresolved resolves
the frontend's `@/choices/*.json` imports, which bin/build-choices.sh
generates and git ignores. A checkout that never built them, such as CI's
fresh codex-ci container, fails `make lint` and `make fix` with 19
unresolved-import errors. Give lint and fix the same build-choices
prerequisite test-frontend and build already have.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…955)

* feat(browser): mark finished items with a check cap, not a thick bar

Issue 856 feedback: the 6px grey finished bar was hard to tell from the
3px reading bar when scanning a grid, and only really read when two cards
sat side by side. The dimmed caption was a second cue that made read
titles harder to read.

Every bar is now 3px. A finished comic or all-read collection ends its
bar in a 10px grey check circle, the same grey as the fill. The bar runs
under the cap to its centre so the two join with no gap. The check is
stroked in the page background instead of cut out, because a cut-out
would show the track through it. The fill is still the real bookmark
position, so a comic marked read but never opened is an empty track and
its cap.

Read titles and subtitles keep their normal colour.

The bar is now one component, ReadStateBar, used by both the browser
card and the metadata dialog. They had duplicated its CSS, and the cap
would have been a third copy to keep in sync.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(metadata): draw the read state under the cover, not behind it

The read state bar in the metadata dialog has been invisible since the
read state landed in v2.4.0. It sat 15px up over the cover's bottom edge,
where the old v-progress-linear used to be. That component is
positioned, so it painted over the cover. The plain div that replaced it
is not, and the absolutely positioned cover image painted over the bar.

It now sits 1px under the cover at every breakpoint, as on the browser
card, which moves the dialog's buttons down about 16px.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s bare root (#957)

A route whose collection pk resolves to nothing redirected to that
collection's own bare root. Under a Publishers top collection that is
`/series` (or `/volumes`) with no parent ids: the backend sends only
the root crumb, the client hides it as the current view, and `/`
resumes the saved last route, so the user is stranded until they
switch top collection.

A tag write that moves a series' or volume's comics elsewhere triggers
it on the next refresh: the ACL resolves through `comic__`, so the
emptied group no longer resolves.

Reuse `_get_up_page_redirect`, the out-of-bounds page redirect's
target: the top collection's root, or the folder / story arc root.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ands the browser (#958)

A bare nav-collection root below the top collection (e.g. /series under
Publishers) has no breadcrumbs, and "/" resumes it. Only a search belongs
there. Three frontend paths left the browser there after the search ended:

- "Clear Filters and Search" (clearFilters(true)) assigned the reset
  search straight into state, skipping _validateSearch, so the redirect
  made on entering the search was never undone.
- loadSavedSettings discarded the redirect _validateAndSaveSettings
  returned. A saved view without a search stayed at the search root.
  One with another top collection stayed on the old route, where the
  server's _validate_top_collection rewrote the view's top collection:
  a Folders view loaded at the Publishers root came back as Publishers.
- _validateSearch only undid the redirect at the current
  lowestShownCollection. Showing a deeper level mid-search, or loading a
  saved search that shows one, left the old search root behind.

clearFilters(true) now takes its redirect from _validateSearch,
loadSavedSettings goes through setSettings, and clearing a search leaves
any bare imprints/series/volumes root.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The saved-settings DELETE endpoint and API client already existed, but
nothing in the UI called them, so a saved view could never be removed.

Each saved view in the settings drawer's "Load Saved View" menu now has
a trash icon. It opens a "Delete View" confirm dialog naming the view;
the click is stopped so it doesn't also load the view. The dialog lives
outside the combobox so the menu closing can't unmount it. The item
slot keeps Vuetify's role="option" on each entry.

The new deleteSavedSettings store action reloads the list even when the
delete fails, so a view already deleted in another tab drops out.

Adds the first tests for the DELETE endpoint: it removes the view with
its filters and last-route rows, and 404s for another user's view, the
unnamed current-settings row, and an unknown pk.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
ajslater and others added 29 commits November 24, 2026 10:01
…igration 0061 (#1044)

* chore(migrations): rename 0061 to reading_lists_and_versedb_key

0061 has not reached a release, so its name can still change. Name it for
what it does: the reading-list tables and data steps, and the VerseDB key
column.

A dev database that applied 0061_post_v2_7_1_schema needs
`migrate codex 0061_reading_lists_and_versedb_key --fake`. A renamed
migration is one the recorder has never seen, so it would re-apply.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* Telemetry: count reading lists, filter use and the first tagging source

Shelves became reading lists, which dropped the count of single issues
people shelve, and the lists themselves reported little. Counts and
closed vocabularies only:

- usage: list_sources by source kind, list_entry_count,
  list_entry_missing_count and personal_list_entry_count.
- tagging: default_source_first. default_match_mode and
  default_prompts_mode report "other" outside their enum, as
  default_effort did, and the source buckets key off codex's registry.
- per_user: show_missing_issues, plus browser_filter_users and
  browser_match_all_users keyed by the filter's name. What a filter is
  set to is never selected.

Chronicle needs columns for the new keys before v2.8.0 ships.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* v2.8.0 review fixes: live sync dispatch, reader list, copy access, preview cache

Eight findings from the pre-release review, each with a test that failed
first.

- Dispatch ReadingListLiveSyncTask. It had a priority and a handler but
  no case in ScribeThread.process_item, so it never ran: a large
  collection added to a list stayed empty, and the nightly sync was
  skipped. A test now drives every ranked scribe task through the
  dispatcher.
- The reader reads the list it was asked for when a comic is on several,
  and falls back to the first in order, not to a set's hash order.
- Copy to My Lists copies only the collection items the copier may see,
  and list counts respect the comic ACL.
- Reading-list previews get a cache of their own, so its cull cannot
  drop pending tagging prompts. A token is deleted once imported.
- Duplicating a list whose name is near 128 characters no longer loops.
- A hand-added issue folds into the tag row that holds the same comic,
  so a list written into its comics' files reads back once.
- Migration 0061 pairs each list with the row bulk_create returns, so a
  story arc whose sort name cleans differently cannot abort the upgrade.
- A Tag Online task joins a running session only when nothing is pinned
  and its settings match, so it cannot inherit a Tag by ID run's issue.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Co-authored-by: Ryan Haines <ryanhaines@homelab.tail7d83f7.ts.net>
… restore (#1045)

* B3: a hidden list entry gives its list no cover or table cells

The card's cover subquery and every table-view intersection query joined
a list's entries without `ignored=False`, so a hidden comic could cover
the list and blank or skew its row's shared values. Both now carry the
shown-entries test in the same Q as the list relation, so it rides the
same join.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B4: adding a comic a list holds hidden shows it again

`add_comics` skipped any comic the list already held, hidden entries
included, while the add-to-list menu reads only shown entries: the menu
offered the comic as absent and ticking it added nothing. A hidden entry
of the comic is now shown again in place and counts as added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B5: tags sync renames only lists its tags lead, one list at a time

A changed arc renamed every list holding its tags source, so a curated
list combined with tags took the arc's name. Only a list whose primary
source (first by rank) is the tags source is renamed now.

Every arc's create, attach, update and removal ran in one transaction,
so one failure, such as a rename onto a name the list's owner already
uses, raised out of the sync and rolled back every other arc, on every
run. Each arc now runs in a savepoint of its own; a failure is logged
and left for the next sync.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B6: a deleted or revived comic re-stamps the reading lists holding it

The delete and revival passes collected StoryArc pks, but the timestamp
updater reads ReadingList pks, so a list never got a new updated_at when
one of its comics was hard-deleted or revived and an open view of it
never refreshed. The collector now gathers the lists holding each comic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B7: a failed recombine keeps a refreshed source's old revision and ranks

`refresh_source` saved the new document and revision, and `rank_sources`
the new ranks, before recombining and outside any transaction. A
recombine that failed left the new revision, so every later refresh read
the list as unchanged and it never recombined. Both writes now share one
transaction with their recombine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B8: the list matcher prefers a live comic to one pending delete

Ties between copies of an issue broke on the lowest pk, which is the old
row a moved file leaves stamped `missing_since`: nobody can see it and
the reap deletes it. Both the comicbox and the series-issue passes now
take a live comic first. A stamped comic is still matched when it is the
only copy, so a list survives a briefly unmounted share.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B9: reader settings refuse a bad or unseen scope pk

`?reading_list_pk=` went through a bare `int()`, so a non-number was a
500; it is a 400 now. A scoped PATCH made a settings row for any pk: a
list another user owns, or a series or list that does not exist, which
then failed its foreign key. The scope's target must now exist and be
visible to the user (a list by the list visibility rule, anything else
by the comic ACL, stamped comics included as the reader is), else 404.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B10: reading-list edits take the write lock before reading

SQLite starts transactions deferred. Under WAL, the menu PATCH, adding
or removing issues, and a reorder each read before their first write, so
a commit from the librarian in between made the write fail at once with
SQLITE_BUSY_SNAPSHOT ("database is locked"), whatever the busy timeout;
reproduced on a WAL file outside the suite. Each now opens with the no-op
update live.py already used for this (`_lock`, now `lock_list`).

The test database is in memory, where the error cannot happen, so the
test checks the cause: the first statement of each transaction an edit
opens is a write.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B11: Continue Reading skips a comic the browser's filters hide

Continue picked the first unfinished comic of the list, but the reader
applies the browser's filters inside a list, so a filtered-out comic
opened to a 404 dead end. Continue, from the card menu and from the
metadata dialog, now takes the first unfinished comic the reader would
read under those filters. `filters_within_a_list` is the one rule both
read through.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B15: under Reading Order list cards read by name, covered by their first issue

Reading Order is the automatic default, and on the lists grid it had
nothing to order by, so the cards fell back to pk order, and each card's
cover was its earliest-dated comic. The grid now sorts by name under
Reading Order, and a list card's cover is the comic at its first
position, read off the entry the cover subquery already correlates on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B16: a comic two ticked lists share counts once in a card's sums

Reading Order under the Reading Lists filter joined each comic to its
entries in the ticked lists, so a comic on two of them joined twice and
doubled in every sum over a card's comics: pages, read pages, progress.
The first position is now a subquery per comic, aggregated per card, so
the comic join is never multiplied.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B21: Pause stops online tagging during the stored-id prepass and its waits

The online tag thread reads its queue only between search results, so a
Pause sat in it through the whole stored-id prepass, which on a re-tag is
the whole run, and through any rate-limit wait. The daemon now hands a
Pause to the running scan as it arrives (as it already does to cancel a
reading-list fetch) and still queues it for a scan that starts after.
The prepass stops before its next comic, leaving the rest for Resume,
and its fetch waits on the scan's pause event instead of sleeping out
the rate limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B22: refuse an online-tag scan the daemon cannot run, before the 202

Starting a scan answered 202 for any effort string and, by default, for
all three sources whether or not each had a key. The daemon then raised
ValueError or OnlineConfigurationError and the admin watched a spinner
for a scan that never started.

- An omitted source list now means the sources with keys, the admin's
  default order first. None keyed is a 400.
- A named source without a key, or an effort comicbox does not know, is
  a 400 that says which.
- Resume refuses a stored scan whose source has since lost its key.

Tests that started or resumed scans with no keys at all now configure
the keys their scans name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B23: the online-tag launcher sends the effort it shows

`startSession` never put `effort` in the request, so every scan from the
launcher ran at the admin default whatever the Effort select said. It is
sent now. The server took an empty effort, the select's Auto, as "not
given" and replaced it with the admin default; only an omitted effort
falls back now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B24: a failed credential save keeps the typed key; source panels stay put

`updateTaggingDefaults` swallowed its error and resolved the same way on
failure as on success, so the Tagging tab cleared the typed API key after
a rejected save. The action now resolves whether the save landed, and a
failed save keeps what was typed.

Each source panel's open state was a fresh array literal in the
template, so any re-render handed the panel a new value and snapped an
opened panel shut. The state is kept in `data` once toggled; a newly
keyed source still folds its panel after a successful save.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B25: a re-queued series prompt no longer offers the old issue's candidates

A pick that names one issue cannot speak for the rest of the series, so
those comics go back in the queue under the same question. The re-queued
prompt kept the representative's candidates, which are that comic's
issues: choosing one again pinned its issue id and wrote it onto a
different comic. The re-queued prompt now carries no candidates; its
comics can be skipped and tagged again, never written with another
issue's tags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B20: a strict-xfail test for Merge all sources skipping keyless sources

Not a fix. The stored-id prepass takes a comic out of the run when any
selected source has its id, so under Merge all sources a source with no
stored id, such as a newly keyed VerseDB, is never asked. The test states
what the Tagging tab promises, every enabled source queried, and is
marked strict xfail until AJ rules on the change, which alters how many
API calls a re-tag makes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B27: backups keep Merge all sources, the default effort and file renaming

The tagging defaults row in the user-data backup had no columns for
`merge_all_sources`, `default_effort` or `rename_files`, so a restore set
all three back to their model defaults. The sidecar schema, the dump and
the restore carry them now; a backup written before has no such columns
and leaves the defaults standing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B29: a stored unknown default source no longer fails every Tagging tab save

`default_sources` is validated on write only, and a restore writes it
without that validation, so a backup naming a source this build does not
register put the name in the row. The Tagging tab sends back what it read
with every auto-save, and each save was a 400. The defaults now read
without names outside the registry, so the next save stores the list
clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B30: the lang: search alias searches the language

`"language": ("lang")` is a string, not a one-element tuple, so the
field's aliases were the letters l, a, n and g: `lang:` searched nothing
and `a:` searched the language. A test now refuses any alias entry
written as a string.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B26: a saved filter on a tag list survives a rebuild and restore

A saved Reading Lists filter was dumped as list uuids. A list made from
tags alone is not backed up; after a rebuild the tag sync makes it again
under a new uuid, so the restored filter named nothing. v2.7.1 restored a
story arc filter by name. The backup now also records the tags ref, the
arc's sort name, of each filtered list made from tags, and the restore
resolves it to whichever list holds those tags now, beside the uuids.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B28: restoring old shelves follows the list name rules and keeps unimported comics

Restoring a backup's shelves as lists used the raw shelf name, so a shelf
whose name cleaned to nothing made a nameless list. Its name is now
cleaned as the shelves migration cleans it, with the same "Reading List"
fallback, for the shelf, its items and a saved filter naming it. Two
shelves that clean to one name share the list, as a restore reuses a list
of that name; the migration numbers them, which a repeated restore could
not do idempotently.

A shelved comic the library did not have yet was dropped, so a restore
run before the import finished lost it for good. It is now a missing
issue named from its file, which the rematch after an import finds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B19: Metron card types, non-Latin export names, ?list= once, a notice's timer

- The preview upload sends `sources` as a JSON string in a multipart
  form, which the camel-case parser never converts, so a Metron card read
  `list_type` from a `listType` key and lost its type. Those keys are now
  converted as a JSON body's are.
- Exporting a list named outside Latin-1 sent a Content-Disposition that
  Django MIME-encoded whole (`=?utf-8?b?...?=`), which no browser reads as
  an attachment. It is built by Django's helper, with `filename*`.
- The reader read `?list=` on every load of the book, so a later reload
  forced the list back over a reading order picked since. It is read
  once and dropped from the route; the server keeps the arc.
- A notice replacing one still showing kept the snackbar open, and
  Vuetify starts its timer only when it opens, so the second notice
  closed on the first one's time. Each notice now remounts it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B12: missing-issue placeholders take the small cover size on small screens

At 960px and below the browser grid's columns are small covers (100px)
but the missing-issue card and the collapsed run card kept the desktop
size (165x254), so they overlapped their neighbours and ran off the
screen. Both now take the small cover size at that breakpoint, as the
comic cards do.

Checked in the browser pane on a scratch stack: at 375px every
placeholder and the run card measure 100x154 beside 100x154 comic
covers in 100px columns (they measured 165x254 before); at 1280px all
measure 165x254.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B13: Edit Issues shows a held collection as one row that acts on the collection

A list holding a series, folder or other collection listed every issue
it brought as a row of its own, and every control on those rows (find,
map, hide, move) was refused by the server, since such an issue is the
collection's. The entries response already carries the list's items, so
the dialog now folds each collection into one row at its first issue,
under All: its name, how many issues it brings, a position field on a
list without sources, and Remove, which removes the collection. A
collection whose target is gone shows as gone, with nothing to remove
through the items API.

Checked in the browser pane on a scratch stack: a personal list holding
a series shows "Other Series — 2 issues, kept current" in place of its
two issue rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B18: disabled controls say why in words; a checklist review filter; no repeated menu title

- Eight disabled buttons explained themselves only with a title, which a
  disabled button never shows: Continue Reading in the list details,
  Combine and Write to Files in the admin bulk bar, Accept All Best
  Guesses in Edit Issues, Preview and Import in Add Lists, and Combine in
  the combine dialog now show the reason as text beside them while off.
  A source with nothing to fetch (an upload, the tags) has no Refresh
  button at all, rather than one that is always off.
- Edit Issues filtered with a mandatory toggle whose "All" overlapped its
  other choices, and the bar did not wrap at 375px. It is a checklist of
  Needs Review, Missing and Hidden, where nothing ticked is every issue
  and several ticked show any of them, and the bar wraps.
- The Reading Lists menu opened with a "Reading Lists" header that every
  opener already says; it is gone, and so is the one-use MenuSection.

Checked in the browser pane on a scratch stack at 375px and 1280px: the
Review bar's chips, hint and disabled Accept button; the bulk bar's two
reasons on their own line; the reader's Reading Lists menu starting with
the lists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B17: an empty personal list's Open is off, and says why

Open on an empty list routed to a browse page that cannot resolve, so it
bounced back to the list of lists with no message. In the drawer's own
lists, Open on an empty list is now off with its reason as visible text,
"Empty. Add issues from any Reading Lists menu.", and does nothing.

The small fix, as directed. A list with entries but no comic the viewer
can see (only missing issues) still bounces; letting an owner's list
resolve in the browser is the alternative that would cover both.

Checked in the browser pane on a scratch stack at 375px: the empty
list's menu shows Open greyed with the reason under it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B14: list changes reach the menus, the drawer, the grid and a ticked filter

- The admin tab's delete, bulk delete, combine, Copy to Global, rename and
  Make Private change lists in the request and broadcast nothing, so
  other views kept the old lists. They now send the same lists-changed
  and library-changed notices a librarian job sends: menus, drawers and
  the admin table reload, browsed pages check their mtime.
- A list deleted elsewhere is dropped from the server's stored filters,
  but a client's own ticked Reading Lists filter went on naming it. On a
  lists-changed notice the browser compares its ticked lists with the
  server's and reloads its settings when one is gone, and only then.
- A membership change refreshed the page only in table view with the
  Reading Lists column shown. A page showing a list, its own or under a
  ticked filter, now refreshes in place in cover view too, and so does
  the grid after Edit Issues from the drawer.

Checked in the browser pane on a scratch stack: on a list's page in
cover view, taking a comic out of the list refreshed the grid from five
issues to four; an admin delete through the API dropped the list from
this client's menus within seconds, with no reload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* NEWS: fixes to v2.7.1 behaviour from the v2.8.0 review

One line each, compressed where related, for A8, B9, B21 to B25, B27
and B30: the fixes to behaviour that already shipped in v2.7.1. Fixes
to code new in v2.8.0 get no line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Format the section B changes

`make fix` output only: line wraps from ruff format and prettier, and the
re-indent of Edit Issues' rows inside their template loop (B13). No code
changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Gate fixes for section B

Lint, type-check and complexity fixes to the section B commits: a
None guard before the scope model lookup, the continue view on the
settings base alone, typed test doubles, helpers that keep the matcher
methods under rank C, and the new B3, B27 and B28 tests in their own
files so the two test modules keep maintainability rank A.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B24: the VerseDB card test's save stub reports success

`updateTaggingDefaults` now resolves whether the save landed, and this
stub resolved nothing, so the tab read its key save as failed and never
enabled the source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* A6: a folded hand-added entry stays hand-added, so its comic outlives the source

A6 folded a hand-added entry into the source row that holds its comic, so
a list written into its files reads back once. The folded entry was
deleted and the row was the source's alone: removing that source, or the
comic's arc tag, took the comic out of the list. A list whose every entry
folded counted as tags-only, was rebuilt from its arc, and was deleted
once the arc had no comic left.

- A folded row keeps `manual`, so the comic stays when the source goes,
  and a written list is never tags-only or disposed of, as before A6.
- It keeps the entry's hidden flag and a cleared review, and in a locked
  order its place, through every recompute.
- Removing it hides it, as for any row a source supplies; a pick on it
  makes it its source row's again, so the pick holds.
- A hand-added entry no source row takes is supplied by none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B1: removing a list's last source removes the rows it supplied

A list no source feeds took the hand-made path, which keeps its entries
as they are, so removing the last document or tags source left every row
that source brought. Such a list now keeps only what was added by hand.
A hand-added entry folded into one of the dropped rows stays, once, and is
supplied by no source again, so removing it deletes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* A6: a tagged entry's comic cannot be picked or marked missing

A pick or "not in library" on an entry whose row comes from the tags
source answered 200 and cleared the folded entry's `manual`. The next
recompute ignores picks on a tagged row, as its arc tag says which comic
it is, so the comic came back and the entry was no longer hand-added: it
left the list when its arc tag or the last source went.

Both are refused now with a reason that says what to do instead: hide
the entry, or take the arc tag off the comic. That also ends the silent
revert of a pick on any tagged row, folded or not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B4: a hidden source row a person adds back is hand-added

Adding a comic the list held hidden cleared `ignored` and answered
"added", but a source's row stayed `manual=False`. It went when the
source was removed, when a refresh dropped it, or when its arc tag went.
It is now recorded as hand-added; a hand-added row a source supplies is
a folded entry, which outlives its source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B1: combining lists no source feeds keeps the others' entries

Older than this branch, in the path B1 rewrote: a list with no source
recomputed from its own entries and ignored the edits `combine_lists`
passes. Combining lists of hand-added entries alone, such as two Copy to
Global lists, deleted the absorbed lists and dropped their entries.

That path now builds the list from the combined edits: the primary's
hand-added entries first, then each other list's, in order. A comic an
earlier list holds comes once, as combining sources joins one issue; a
list's own repeat stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B5: a rename onto the owner's other list is skipped, not failed on

A tags-led personal list renamed to a name its owner's other list has
raised inside the arc's savepoint, which rolled back the source's new
revision with it. Every later sync saw the same change, failed the same
way, and the list never followed its arc again. The rename is skipped
when the owner already has the name; the list keeps its name and still
takes its arc's comics. Numbering the name instead would flip between
"(2)" and "(3)" on each change, since the list's own name is taken.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B8: live first only among the strongest matches

The matcher dropped pending-delete comics before choosing the strongest
rule. While a list's own comic, found by its issue id, was stamped (a
share unmounted), a different live comic found only by name took the
entry, and a rematch never revisits a matched entry. The strongest rule
now wins first, and a live copy is preferred only among its finds, which
is the moved-file case B8 was for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B15: the cover test checks again that date order would pick otherwise

The gate-fix commit turned `assert c3.date > c1.date` into a comment to
please the type checkers. Without it the test would stop proving the
cover is not chosen by date if the fixture's dates changed. The assert is
back, with the two dates checked as set first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B7: keep a failed recombine's guarantee without holding the write lock

B7 put the save and the recombine in one transaction. SQLite takes the
write lock at the first write, so the lock was held through the combine,
the matcher and the includers' sync. On a 3,000-issue list in WAL mode a
reorder held it 1.9 seconds and a refresh 2.5, and another connection's
write waited up to 1.9 seconds; a reorder runs in an admin request,
beside readers' bookmark writes.

The guarantee stays without the transaction. A refresh saves its new
revision only after the recombine, so one that fails leaves the old
revision to try again. A reorder that fails puts the old ranks back. The
longest wait of another writer is now 0.5 seconds, the recombine's own
write.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* A6: the tagged-entry test reads the comic id as the codebase does

basedpyright does not see Django's `comic_id` on the model; the test now
carries the codebase's ignore for it, so `make lint` passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B27: a restore sets only what the backup carried

Opening a backup adds the columns a later release introduced, holding
their defaults: a dump is replayed into a scratch database and the store
reconciles it. So every "does the row have this column" guard in the
restore was always true.

- New with B27: restoring a v2.7.1 or older backup reset Merge all
  sources, file renaming and the default Effort to off and Auto.
- Older, from the VerseDB merge: such a backup wiped a VerseDB key
  configured since, which the guard's comment said it would not.
- The site defaults had the same guard: a newer setting went back to
  its default.

The store now records the columns it added, and `carried_columns` gives
what the file itself had. The tagging and site defaults take only those;
anything else is left as it is. A binary backup is restored from a copy,
so a restore no longer writes those columns into the backup and the next
restore still reads it truly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B26: a filter's tags ref finds a list only when its uuid did not

The restore ticked every visible list holding a filtered list's tags
source, beside the lists the uuids found, so a filter could gain a list:
another list holding the same arc's tags. The backup now records the
tags ref by each list's uuid. The restore takes a list by its uuid, falls
back to the ref only when the uuid finds nothing, prefers the list made
from those tags alone, and reports a uuid that resolves to no list, as
it does an unmatched tag name.

The column is new on this branch, so no released backup has the old
form. The filter's list resolution moves to `restore_filter_lists.py`,
which keeps `restore.py` at maintainability rank A.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B22: an explicit empty source list is refused, not read as omitted

`data.get("sources") or ...` treated `sources: []` like no list at all and
ran every keyed source. An empty list names no source, so it is a 400
now; only an omitted list means the keyed sources.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B22: a refused scan or Resume says why

The launcher and the status table caught a refusal with `setErrors`, which
fills the form errors, and none of the launcher, the Tagging tab or the
status table shows those. A scan B22 now refuses ("No Comic Vine
credentials configured.") just stopped spinning with the dialog open, and
a refused Resume or Pause looked like a broken button. Each refusal's
reason goes to the notice snackbar now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B24: a refused Tagging tab save says why

A failed credential save keeps the typed key since B24, but the reason
still went to the form errors, which the Tagging tab does not show. The
store's save now puts it in the notice snackbar, for the key saves and
the tab's auto-saves alike.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B19: a notice closing keeps its snackbar, so it animates shut

B19 remounted the snackbar on every change of the notice, its clear
included, so a normal close skipped the close animation. Only a new
notice remounts it now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B14: a list change refreshes the browsed page only on the browser

`refreshIfShowingLists` runs after every membership change, wherever the
person is. From the reader, with a Reading Lists filter ticked in the
browser settings, it refreshed a browser page the reader's route has no
collection for: a request to /browse/undefined that failed, and a console
error. It does nothing off the browser route now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B18: a disabled Continue Reading says which of three reasons it is off

The details always said every issue is read. Continue Reading is off
also when the browser's filters hide every unread issue, which B11
made Continue follow, and when no issue of the list is in the library.
For those the text was false, and "mark one unread" enabled nothing.

The details now name the case, `continue_blocked`: all_read, filtered,
or none_in_library, and the dialog shows the matching reason and way
out. The last is said for completeness: the browse metadata of a list
with no comic in the library is a 404, so no dialog opens on one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B25: a re-queued series prompt keeps its candidates and answers by volume

B25 dropped the re-queued prompt's candidates, the first comic's issues,
so no choice could pin one of them on another comic. That left only
Skip, and lost a path that worked: a choice carrying a volume reached
every remaining comic of the series by replaying its search.

The candidates stay, and the prompt is marked re-queued. A choice on it
transfers its volume alone, to every comic the prompt holds, the first
included, each replaying its own search. A choice with no volume speaks
for none of them, so they are asked again. A hand-entered issue id still
applies to the comic shown, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B18: the admin tab's filters are a wrapping row again

The bulk-bar hint rule went in between `.filters,` and `.bulkBar {`, so
the selector became `.filters, .bulkHint` and the filter row lost its
flex, wrap, gap and bottom margin: at 1280px its five controls stacked
one per row. `.filters` shares the bulk bar's rule again, and the hint
has its own. Checked in the browser pane: one 40px row at 1280px, two
to a row with no overflow at 375px, the hint on a line of its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B22: the empty source list refusal says what to do

It read DRF's "This list may not be empty." in the notice; it now reads
"Choose at least one source."

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* NEWS: say what the review corrections made true

A refused scan now says why; a re-asked series prompt answers by volume
rather than dropping its matches; a refused key save says why; and a
restore of an older backup leaves settings it did not carry alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ery, startup tags sync (#1046)

* B16: a list's comics find their first position by the comic's index

B16 ordered a list's comics by a per-comic subquery, `ORDER BY position
LIMIT 1`. SQLite served that order from `readinglistentry_list_pos`
(reading_list_id, position), so for every comic it walked the list's
entries in order until it met that comic. The first position is now an
aggregate, `Min("position")` (`Max` under a reversed order) grouped by
the comic, with no ORDER BY for the planner to chase. SQLite answers it
from `readinglistentry_comic_list` (comic_id, reading_list_id), with or
without statistics.

A 5,000-entry list's own page in Reading Order, on a scratch database
with the same data, medians of five runs, twice each:
- develop 8030e46: 56.7 and 56.8 ms, 20 queries
- PR 1045 as pushed, f1ebca5: 1,079.7 and 1,066.9 ms, 21 queries
- fixed: 59.6 and 59.7 ms, 20 queries

Of the shapes compared, ordering by `+position` also picked the comic
index, after `PRAGMA optimize` and with no statistics. The aggregate
does too without steering the planner by a no-op expression, so it is
the one kept. The old shape used the position index either way.

`SharedComicTests` and `ListCardsTests` pass unchanged: same rows, same
order, a comic on two ticked lists counted once. A new test reads the
plan SQLite picks for a list page's comics query on the test database,
which has no statistics, in both directions. It fails on the shape as
pushed, which used the position index.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B11: Continue Reading asks for no filtered comics when no filter is set

B11 made Continue follow the browser's filters. The stored filters carry
every key, mostly empty, so Continue always ran a Comic query binding
every comic of the list, even when nothing narrowed them. It skips that
query when the filters build no condition.

Continue on a 5,000-entry list, medians of five runs, twice each:
- develop: 15.7 and 16.1 ms, 12 queries
- PR 1045 as pushed: 25.0 and 24.2 ms, 15 queries
- fixed: 17.8 and 17.2 ms, 14 queries
The two left over are the settings read B11 needs. A test checks that
empty filters cost no query.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B2: the librarian syncs unstamped arc lists when it starts

Migration 0061 writes each tags source with a blank revision, so the
first tags sync rebuilds every arc list, and until it runs a hide or a
reorder made to one is lost. That sync was the nightly one, hours after
the upgrade. The librarian now queues it at startup when any tags source
is still unstamped, which narrows the window to the sync's own run.

The check reads the database, so it runs in the librarian's `_startup`,
in its own process, which starts only after the web process has run the
migrations. `LibrarianDaemon.__init__`, where the search sync is queued,
runs in the web process, which closes its connections before starting
the librarian.

Tests: a blank revision queues the sync, no tags source queues nothing,
and after the sync has stamped the revisions nothing is queued again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…se keeps the lookup under way (#1047)

* B21: a Pause keeps the lookup that was under way

The search pass checked for a Pause before it looked at the result in
hand, and dropped it. comicbox's cancel() only sets an event: a lookup
already under way runs to its end, outside a retry wait, writes its
comic into the result and reports it written. So a Pause during a lookup
left that comic matched in the status table and out of the resume set,
but never written, and Resume skipped it. The pass now handles a
cancelled result first, keeps any completed one, and stops after it.

A cancelled result after a Pause is not halted as comicbox stopping the
run, so it gets no pause reason. The bug is older than v2.8.0; v2.7.1's
loop has the same check.

Test: a fake whose in-flight lookup completes normally after the Pause,
as comicbox's does; its comic is written and the rest stay resumable. It
failed first with nothing written. A runner test's fake now returns the
cancelled flag every real result carries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* B20: Merge all sources fetches a comic's stored ids and searches the rest

The stored-id prepass took a comic out of the run when any selected
source had its id, so under Merge all sources a source the comic had no
id for was never asked: adding a VerseDB key and re-tagging fetched
Metron by id and never asked VerseDB. AJ ruled for fetching the ids a
comic has and searching the sources it has none for.

- Ids for every selected source: fetched by id alone, as before.
- Ids for none: the normal search pass, as before.
- Ids for some: looked up in an OnlineSession of its own, pinning that
  comic's stored ids and searching the other sources, merged in the run's
  order. It is the Tag by ID & Search lookup, one comic per session, so a
  comic's ids reach no other comic and a task merged mid-scan joins only
  the run's own session, which pins nothing (A8).
- First match: unchanged.

Why one-comic sessions, not leaving the comic in the run: a plain
session refreshes a source by id only when the comic's file holds that id
in a tag format comicbox reads ids from, MetronInfo, CoMet or
comicbox.json. ComicInfo holds ids as links and notes, which comicbox
turns into ids only in its merged record, and that record is what codex
stores. So for every comic whose ids are only in ComicInfo, which is what
other taggers write, the database holds ids a plain session never sees,
and it would search those sources again: 5 to 8 Comic Vine calls instead
of 1, and a chance of a different issue. A test pins that behaviour, so
its failure will say when comicbox reads them and this can shrink.

The pass runner takes these lookups' results first, so status, progress,
queue drains and quota halts work as in the search pass, and each comic
is counted once. Each session starts from the run's series cache and
gives back what it resolved, so a series is searched once a run.
Mid-scan picks of a volume are preloaded into later sessions. Prompts
from every session are persisted with the run's source order, Merge all
sources and the pinned sources' issue ids, so an answer merges under a
higher-priority source instead of overwriting it. A Pause cancels the
session in flight, its rate-limit waits included; the lookup under way
is still written (B21) and unreached comics stay for Resume.

comicbox fails a source, not the comic, so a search that raises keeps the
by-id half. A pinned id that fails to fetch, for whatever reason, holds
its comic: nothing is written, so a lower-priority source cannot
overwrite what the failed one supplied, and the comic stays queued for
Resume, both halves; the log names the source. A raise while building a
session, or anywhere in the pass, no longer loses the comics already
matched: the runner flushes its batch in its finally.

API calls per source to re-tag an already-tagged comic under Merge all
sources:
- a source with a stored id: unchanged, Metron 1, Comic Vine 1, VerseDB 1,
  plus one series or volume detail per series;
- a source without one: 0 before, since it was never asked. After: for
  the first comic of its series in the run, Metron 2, Comic Vine 5 to 8
  by effort (balanced 7), VerseDB 3; for later issues of that series, 2
  on every source. A one-comic lookup gets no whole-series prefetch.
- A comic with ids for every source, or none: unchanged.

Tests: the strict-xfail test passes as a plain test. New: all ids, no
search; some ids, a search on exactly the others in the run's order; no
ids, the search pass; First match unchanged; isolation, series reuse,
mid-scan answers, a Pause mid-lookup, a failing session build, counts,
and the prompt's provenance through its answer. With comicbox's real
merge and fake sources: Metron, pinned and first, wins; a failing search
keeps the by-id half; a failed stored id holds its comic for Resume; and
a plain session fetches a MetronInfo id by id but searches again for one
only ComicInfo holds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…it (#1048)

A Merge all sources lookup holds a comic back when a source cannot fetch
its stored issue id. It recorded that only in the log: the outcome was
forgotten, so the status table showed the comic as never looked up, and
when the id is gone upstream every Resume held it again with nothing on
screen saying why.

It is not recorded as errored: `_is_pending` treats an errored comic as
done, so Resume would skip it. The outcome stats keep held comics apart,
with the sources that failed. The snapshot shows the row as Error with
Error in each failed source's column, and carries `held`, the count and
the failed sources. The status table words it with its own source
labels, as its columns name them: "1 comic not written: its stored issue
id could not be fetched from Metron Cloud. Resume tries it again; if the
id is gone, tag it by ID." The comic stays pending and in the resume
set, and `resumable` counts it. Counted once: the batch tallies it as an
error row, the summary log as held, never as written. Nothing else reads
these stats; the telemeter does not.

Checked in the browser on a scratch stack with a seeded snapshot, at
desktop width and at 375px: the line sits under the Paused row and wraps
inside the column with no overflow, the tally shows 1 error, and the
held comic reads Error under Metron Cloud and a dash under Comic Vine.

Tests: the held comic's snapshot row reads Error for Metron alone, `held`
names Metron, it is in the resume set, the snapshot is resumable, and
nothing is queued for writing. The status table says it for one comic,
for several comics and sources, and says nothing when none is held.
The snapshot test and the one-comic table test failed first.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ciency (#1049)

* C1: the import's reading-list passes read once, rematch once a burst, and stay quiet

Measured on a scratch database: 6,000 comics, 2,000 arc lists, 300
curated lists, 60 lists each holding two series, and 4,000 missing
entries, 2,000 of them of series the library has. Timings are medians of
five runs with cachalot off and the cache emptied, before and after back
to back.

- Live sync: the lists load in one query, and their items in one query
  for all. The staleness check hands the rows and comics it read to the
  sync, which read them again; a list target is re-read, since any
  request may change its entries.
  - 60 stale lists: 962 queries, 418 ms before; 724 queries, 371 ms after.
  - 60 unchanged: 362 queries, 105 ms before; 244 queries, 85 ms after.
- Rematch: imports outrank rematches, so a burst of imports queued a full
  rematch each, run back to back, at 15 queries and 389 ms apiece here.
  A full rematch that began after another was queued now covers it: a
  burst of N imports runs one. Narrowing a rematch to the comics an
  import touched is not done: entries also match by issue id and series
  mappings, and one full pass of 4,000 missing entries costs 0.4 s.
- A rematch that matched nothing, or a live sync that changed nothing,
  no longer tells every browser to reload its lists.
- An import with no lists and no arc tags: 7 queries, unchanged.

Tests lock in the counts on a small fixture (6 unchanged, 30 stale, 7
for the empty post-phase), that a stale sync leaves the same rows, and
the coalescing and the quiet notices.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* C2: one tick in a Reading Lists menu syncs the list once

The items PATCH synced the list and the lists holding it after each part
of the change: inside `add_comics`, inside `remove_comics`, and again at
the end. `add_comics` and `remove_comics` take `settle=False` now, and
the PATCH syncs once, at the end, inside its own transaction.

Measured with the test client on a list holding a volume, held by
another list: adding a comic 78 queries before, 54 after; removing one
66 before, 42 after; both in one PATCH 77 before, 53 after. A test locks
in 54 and 42, and checks a sync from scratch then finds nothing to do in
the list or its holder. The new-entry builder moves out of `add_comics`
to keep it under rank C.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* C3: the add-to-list menus list one's own lists first

The menu GET ordered by owner, and SQLite sorts a NULL owner first, so a
staff member's own lists came after every curated global list, against
the docstring and the store. Own lists sort first now. A test covers the
order.

Its cost is left as it is, measured on a scratch database with 300
curated global lists of 50 issues: 12 queries whatever the number of
lists, 69 ms for staff, 17 ms for a reader with five lists. C1 already
removed the no-op notices that made every browser refetch it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* C6: a tag filter no longer makes a page of comics DISTINCT

`comic_filter_uses_m2m` was true for any tag filter, so the comics query
went DISTINCT over every Comic column. A tag filter has tested
membership with an IN subquery, never an inline join, since the filter
rework: under Any one subquery, under All one per value, and None in a
subquery too. A comic row cannot repeat. The flag now stays true only
for the paths that still join: a list's own page, and the folder group
on the cover, choices, bookmark and download targets.

Measured on a scratch database (6,000 comics in one folder, three of 300
characters each), medians of five runs back to back: the folder's page
with 50 characters ticked 43.2 ms before, 32.2 ms after; a 50-issue
series with one character 7.7 ms and 7.4 ms, within noise. Same 18 and
15 queries.

Before removing it, a test runs each filter both ways, DISTINCT forced
as before and not, on comics holding several of the ticked tags: any of
two characters, all of two, no character, and two genres with a tag.
The books, their order and the count are the same, and the queries show
the forced run is DISTINCT and the other is not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* C6: the DISTINCT test reads its queries before the next request clears them

`captured_queries` reads the connection's log when accessed, and the
next request's start clears that log, so the check that the new run was
not DISTINCT read the wrong run's queries. The test now copies each
run's SQL as its block ends, with cachalot off so every query runs, and
asserts the new run captured queries at all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* C4: list rows group by their key, and the grouped page loses DISTINCT

ReadingList had no entry in `_COLLECTION_BY`, so a list's rows grouped
by every ReadingList column, description, notes and extra included,
and the query also selected them DISTINCT. They group by `id` now: two
curated orders of one event share a name and stay two cards. Once the
card aggregates group the page query, each list is one row, so its
DISTINCT goes. The page count keeps DISTINCT: it aggregates nothing,
so there the entry joins repeat a list's row.

Measured on a scratch database with 2,306 lists, the lists grid as
staff, medians of five runs, before and after alternated twice:
115.8 and 116.3 ms before, 81.0 and 81.7 ms after; 18 queries both.
Grouping by id alone, keeping DISTINCT, gave 101 ms.

A test runs the grid both ways, the old shape forced and the new, by
name, in Reading Order and by child count. It uses two lists of one
name, a comic on two lists and twice on one, a hidden entry, and
another user's personal list. The cards, their order and the count are
the same, and the new page query groups by the key and is not DISTINCT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* C5: the filter menu's list probes ask per comic, and only with lists

The Reading Lists and Reading List Kind availability probes, five per
menu, each tested `pk IN listed_comics(user)`, which gathers every comic
of every visible list before the probe can stop. They test a correlated
EXISTS per comic now, which stops at the first row. A viewer who sees no
list gets neither probe: one `exists()` answers both.

Measured on a scratch database (6,000 comics, 2,306 lists visible to
staff), the publishers filter menu as staff, medians of five runs, before
and after back to back:
- with lists: 76 ms before, 47.5 ms after; under a search 332 ms, 301.8 ms
- with no list at all: 36.1 ms before, 30.5 ms after; under a search
  333.1 ms, 269.1 ms
13 queries before, 14 after: the one that checks for a visible list.
Without the skip the per-comic form was slower with no lists (45 ms), so
both parts are needed. Under a search the rest of the 300 ms is the
other filter fields' probes, each repeating the FTS match (49 in all);
that is not changed here.

A test compares the whole availability answer with the old probes,
signed in and not, on three collections, under a search and with no
list: a tags list, a curated list, the viewer's list, another user's
list, a hidden entry, and a comic on two lists. Another checks that a
list added after a request changes the same request's answer, so
cachalot tracks the new subqueries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* C7: Edit Issues loads what its rows show and builds a page of rows at a time

Server: the entries GET loaded every column of each entry, its comic,
series and volume, the entry's reference JSON included, which no row
shows. It loads only what `entry_repr` reads now. On a 5,000-entry list
(medians of five runs, alternated twice): 302 and 302 ms before, 187 and
187 ms after; same 13 queries and the same 1,429,791-byte body.

Dialog, measured in the browser pane on a 3,000-issue list:
- Each row worked out its step down by finding itself in the whole list,
  so a render was quadratic. Every row's is worked out in one pass now.
- Hiding or showing an entry refetched the whole list. The PATCH answers
  with the entry and hiding changes no other row, so only that row is
  replaced.
- Building every row's controls at once was the real cost: opening took
  8.9 to 10.9 s with the first two changes alone, 9.5 s before them. The
  rows now render 200 at a time, and 200 more each time the last row
  scrolls into view.

Opening is now 0.6 to 1.3 s (was 9.5 s). Hiding is 0.8 s (was 6.1 s),
showing 1.0 s (was 5.9 s). Checked at 1280px and 375px: the first page,
then 400, 600 and 800 rows as the end came into view, with no
horizontal overflow at 375px.

Tests: the GET's query count (a deferred field read per row would raise
it) and its rows against fully loaded entries; the one-pass step down
against the old rule on a 60-row list with collection blocks, by hand
and with sources; a hide that fetches nothing; the paging.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* C8: reading-list reads bind their comics in batches

Five reads bound one SQL variable per comic or path: a list's details
bookmarks, a list's download order, the matcher's pending check, Write
to Files, and the shelves migration. Debian's SQLite allows 250,000; a
stock build allows 32,766, and past it the query fails with "too many
SQL variables", which in the migration aborts the upgrade. Each now
binds at most `PK_BATCH` (10,000, the batch `references.py` already
used, now public) per query.

Measured by lowering the test connection's limit to one batch plus 100
and handing each read twice that: all five failed with "too many SQL
variables" before, and give the same rows after.
- The download order sorts the batches' rows by position and pk, as the
  one query ordered them.
- The migration helper stays self-contained: `itertools.batched` and a
  local `_in_batches`, no application import. The frozen-migration test
  passes and `makemigrations --check` reports no changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* C9: a list's export reads its entries once

`export_document` built the header with `document_of`, which also loads
every shown entry's reference, then replaced those entries with its own.
The header comes from `document_header` now, and `document_of` uses it,
reading its references as values rather than whole entries.

On a 5,000-entry list exported as json-cbl, medians of five runs
alternated twice: 911 and 952 ms before, 853 and 861 ms after; 15
queries before, 14 after. The export tests show the same documents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* C9: the nightly backup reads an entry's comic path, not its whole comic

The reading-list dump joined each entry's whole Comic row to write its
path. It loads the entry fields the row writes and the comic's path.
On a scratch database with 22,200 backed-up entries, the reading-list
dump took 987 ms before and 680 ms after (medians, alternated), with
the same rows. A test checks that the dump's query count does not grow
with its entries, which a deferred field read per entry would break.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* C9: the admin lists table reloads on a notice only while it is on screen

Every reading-lists notice reloaded the admin table for any admin who
had opened the Reading Lists tab once, wherever they were since. With
2,306 lists that GET takes 172.7 ms and 6 queries on a scratch database.
It reloads only on that tab now; the tab loads its table afresh when it
opens, so nothing goes stale. The table is a `v-data-table-virtual`
already, so the review's other doubt does not apply.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* C8: Continue's filter read binds its comics in batches too

B11, on develop since C8 was written, added a read to Continue Reading
that binds every comic of the list in one IN when a browser filter is
set. On a list past the SQLite variable limit that failed with "too many
SQL variables", the failure C8 removed from the other reads. It reads
`PK_BATCH` comics at a time now; the filters test each comic on its own,
so batching changes nothing else.

Test: Continue's filter read under a lowered variable limit, with a genre
filter set. It failed first with "too many SQL variables".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* C7: Edit Issues keeps paging after a filter or a hide

The "more" row was observed only from the `shown` and `allEntries`
watchers. A filter round trip re-creates the row through its `v-if`, and
setting `shown` back to a page it already held changed nothing, so the
new row was never observed: "Showing 200 of 3000", and no more ever
loaded. Hiding an entry splices `allEntries` in place, which the
non-deep watcher did not see, so a row that hiding brought onto a
filtered page was not observed either. The row now has a function ref,
which observes whatever row is there whenever Vue creates it; `shown`
still re-observes it so the observer reports whether it is in view.

The page size is a prop, 200 by default, so the tests page through five
rows. The paging test mounted 500 rows through real Vuetify and timed
out under load; each test now takes well under a second.

A drag reaches only the rendered rows. Dragging toward the end brings
the more row into view, which loads the next page as scrolling does,
and a far position is quickest typed in the row's position field, which
reaches any position. That is left as it is.

Tests, with a recording IntersectionObserver: paging goes on after a
filter round trip; a row hidden onto a filtered page brings its more row
and it pages. Both failed on the old code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* C6: a search token on a many-to-many tag tests membership, not a join

A field token with a glob, quotes or an operator is a database lookup,
not a full-text match. On a many-to-many tag it was a plain lookup such
as `characters__name__icontains`, an inline join, so a comic holding two
matching tags came back twice: a series page searched for
`characters:*bat*` showed a comic with Batman and Batgirl as two cards,
counted two, and shifted the pages after it. Before C6 any tag filter
made the page DISTINCT, which hid it then; without a tag filter it
showed already. Credits, tags, teams and the other many-to-many fields
did the same.

Such a token is a membership test now, `pk IN (comics matching it)`, as
the tag filters are: one row per comic, so C6 keeps its DISTINCT-free
page. Each operand is its own test, so `characters:(*batman* and
*batgirl*)`, or the two as separate tokens, finds a comic holding both,
where before one joined tag had to match both names and nothing came
back. A negated token was already a NOT EXISTS subquery and is
unchanged. Cachalot tracks the subquery's tables through the codex
shim: a tag added between two identical requests shows in the second.

Tests: one card and a count of one per comic, with and without a tag
filter, for characters, credits, tags and teams; negated tokens; AND and
OR; a group page; the cache. All but the negated and group cases failed
first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* C2: a menu tick commits before it syncs, and queues after it commits

C2 moved the PATCH's one sync inside its transaction. That held the
list's write lock through the list's sync and every holder's, and a
holder's failure rolled the user's tick back. The change commits first
now and the sync runs after it: syncing is idempotent, and it stays once
per PATCH.

A list held by five lists, each also holding a publisher of 2,000
comics, one hand-added comic added or removed per tick, medians of ten
ticks, before and after alternated: the write lock was held 85.7 and
95.1 ms (max 118 ms), and is held 5.0 and 5.0 ms (max 6.1 ms). The
whole request takes 113 ms instead of 91 to 101 ms, since each list's
sync now commits on its own. The query counts C2 locked in are the same.

When an item is too large to sync inline, the librarian job was queued
inside the transaction, so an idle scribe could read the list before
the item existed and sync nothing. It is queued on commit now. And the
rest of the change waited for that job: a comic added by hand in the
same tick, which an item already delivered, showed twice until the job
ran, and the count said so. The list syncs inline now with the large new
items left out (`reconcile_list(skip=...)`, which keeps their blank
revision for the job); the job syncs them and the holders.

Tests: a holder's failure keeps the tick; the large item's sync is
queued only once the change commits; a hand-added comic shows once
while a large item waits; two collections in one tick. The first three
failed on the old code. The large-collection API test now runs the
commit hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* C1: a full rematch covers others by queue sequence, once it finishes

C1 let a full rematch stand in for the full rematches queued before it
began, so a burst of imports runs one. It stamped when it began before
it ran, so a rematch that raised part-way still covered the ones queued
before it, and they were skipped. It also compared wall-clock times,
which move when the clock does.

The scribe queue already gives every task a sequence number to break
priority ties. A rematch is stamped with it as it is queued (`seq`), and
a full rematch takes a fresh number as it begins and records it only
once it finishes; a full rematch numbered below the last one recorded is
covered. One queued while another runs is numbered above it, so it
runs. The nightly janitor calls the worker directly, unstamped, so it is
never covered, and it covers the ones queued before it began.

The live sync's read cache (`_Read`), for the record: it keeps each
distinct collection's comic pks for the whole run, 36.5 bytes a pk (an
8-byte list slot and a 28-byte int). A forced run over 100 lists of
distinct collections on the scratch database, three publishers of 2,000
and 97 series of 50, cached 10,850 pks (396 KB), with a 4.3 MB traced
peak for the whole run. Publishers, imprints, series and volumes each
partition the library and folders nest, so on a 100,000-comic library
lists of distinct collections of one kind hold at most 100,000 pks,
about 3.7 MB, and lists over all four kinds and folders five deep about
33 MB, for the run's length. Left unbounded.

Tests: the queue stamps rematches in order; a burst runs one; one queued
while another runs still runs; an aborted rematch covers nothing (it
failed with the stamp taken before the run); the nightly rematch always
runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* C5: the list probes seek a comic's entries, and skip kinds with no list

The review asked whether C5's correlated EXISTS holds up when lists are
sparse in a large library. Timed on two scratch databases, the publishers
filter menu as a reader and as staff, with no search and with a search
for "story", which matches every comic; medians of five, two rounds:

- dense, 6,000 comics, 2,367 lists, the reader with five lists of their
  own and every tags list visible;
- sparse, 60,000 comics, one 10-comic list of the reader's, no other.

C5 as committed made the dense reader's menu 99 -> 769 ms and, with the
search, 410 -> 1,082 ms; staff, whom C5 was measured as, went 76 -> 47
ms. The plan showed why: with `reading_list_id IN (visible lists)` on
the comic-and-list index, SQLite seeked once per visible list for every
comic, about 2,000 seeks a comic for a reader. The sparse reader went
240 -> 305 ms: probes for kinds the reader has no list of scanned all
60,000 comics, where the old IN found an empty set at once.

The list is tested as `reading_list_id + 0` now, so SQLite seeks a
comic's few entries and checks each against the visible lists. And a
kind the viewer has no list of is not probed: one `exists()` per kind on
the lists table, which can only drop a kind that would not be offered.

Old shape (before C5) -> now, round one and two:
- dense reader 98.6/100.7 -> 71.2/71.0 ms; with search 414/427 -> 383/388
- dense staff 75.0/80.8 -> 44.3/44.5 ms; with search 373/387 -> 329/331
- sparse reader 245.7/280.1 -> 259.0/288.6 ms (+4%, within the rounds'
  spread); with search 3,837/3,805 -> 3,547/3,522
- sparse staff 242/276 -> 239/269 ms; with search 4,015/3,975 ->
  3,376/3,347
The menu runs up to three more small queries, one per kind.

Tests: the equivalence test still compares every answer with the old
probes. New: a kind probe's answer changes with its entries in the same
cached request, through the probe annotation itself (the old cache test
flipped through `reading_lists_of`); a reader with only lists of their
own probes only Mine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* C4: the list rows equivalence test covers search, table view, missing comics and visitors

The review found C4's equivalence test ran the lists grid both ways only
signed in, unsearched, in cover view and with every comic present. It
now also runs, old shape forced and new: under a full-text search, in
table view (whose rows it compares whole), with a comic gone from disk,
and for a viewer who is not signed in. Each gives the same rows, order
and count both ways, and the new page query groups by the list's key
without DISTINCT.

A field token search cannot be one of them: on the lists grid it raises
a FieldError, an older bug, reported separately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…try, dead code and wording (#1050)

* D: migrated shelves keep their times, and their comics' ids

Two review leftovers in the unreleased 0061 shelves step, both small and
inside the migration helper.

A shelf became a list made and last changed at the upgrade. The list
now takes the shelf's `created_at` and `updated_at`, set by an update
after the list is built so neither stamp is taken again.

A comic on a shelf became a hand-added entry whose reference held its
series, volume, issue and date but none of its ids, where a comic added
by hand now gets its issue ids and its series' id too. Such an entry,
its comic removed and imported again, rematched by name alone. The
helper's frozen reference builder now adds both, as
`references.comic_references` does; the issue type is the string
"comic", since a migration imports no application code.

Tests: a shelf with past times keeps them; a shelved comic with issue
ids on two sources, in a series with its own id, gets exactly the
reference the live builder makes. Both failed first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* D: list fetches and the Add Lists dialog read the source registry

`reading_list_credentials()` built comicbox's credentials by hand, for
Metron and Comic Vine. It is `sources.build_credentials` now, as tagging
uses. The result is the same for every caller:
- no defaults row: None, before and after;
- no key set: an object with empty keys before, None now. comicbox reads
  both alike, falling back to its config for a key the caller leaves
  unset (`_credentials` in its Metron and Comic Vine list sources), and
  the nightly refresh drops Metron kinds for either;
- keys set: the same Metron and Comic Vine key and url; the registry
  also passes VerseDB's key, which no list source reads.

The Add Lists dialog read `has_metron_credentials` and
`has_comicvine_credentials`, which `configured_sources` replaced. It
reads `configuredSources` now: the same key check, from the registry.
That left the tagging serializer's six per-source booleans with no
reader in the app (the Stats tab's `has_*_credentials` are the stats
serializer's own). All six are gone; the stats fields stay. Four
settings tests read them as their check that a key saves or clears;
they check `configuredSources` now, and a tab test's fixture mocks it.

Tests: what a list fetch is handed with no row, no key and every key,
and that comicbox resolves None and empty keys to the same auth for both
list sources. The no-key case failed first (an object, not None).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* D: remove reading-list code nothing calls

Each searched for in the backend, the frontend, the tests, the docs and
the vulture allowlist first.

- `entries.next_position`: exported, never called.
- `entries` re-exported `can_edit`: everything imports it from `access`.
- The entries GET answered `"editable": True` always; no client read it.
  The `editable` the UI reads comes from the lists and details answers.
- `documents.arc_pointer`: exported, never called.
- The API wrappers `getAdminList`, `deleteAdminList`, `abortFetch` and
  `addEntries`: never imported. The endpoints stay.
- The browser page's `missing_count`: no client read it, only two
  assertions in tests of other things. One goes; the dangling-entry test
  asserts the page has no placeholder entries instead. It was new in
  2.8.0, so no released client lost it. `page_missing_entries` now
  returns the page's entries alone.
- The metadata store's `TAG_NAMES`, an empty table consulted on every
  label: the label is the capital-cased key, as it always was.
- `page_bounds` special-cased a list with no comic. Django's paginator
  already allows an empty first page and refuses the rest, so the case
  gave what the paginator gives; a new test pins both, before and after.

Left, with behaviour tests: `?filter=` on the entries GET and `POST
<pk>/entries`, which the web UI no longer calls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* D: reading lists wording, "Imported", and the sidecar version as a record

Four comments and docstrings still named shelves where they mean reading
lists. The reading-list import status derived its past tense as "Importd";
it names it now, and a test walks every librarian status so a derived past
tense is only ever a verb ending in "e" plus "d". The sidecar's
schema_version row stays as a record of the layouts a file was written
with; a comment says nothing reads it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Merge the piecemeal items by feature, drop fixes to code that never
shipped and two v2.7.1 bugs no ordinary user could reach, and name the
reading-lists API that replaces shelves. The section is now about 1,575
characters, under Discord's 2,000.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1051)

* D: the entries GET takes no filter

AJ's ruling on the review's recommendation: remove it before release. The
`?filter=review|missing|hidden|all` parameter was new in 2.8.0. Its only
caller, Edit Issues, always sent "all" (no narrowing) and filters on the
client. The GET now returns every entry the editor may see, hidden ones
included, which is what "all" and no parameter both gave. The body is
unchanged.

Removed: `_FILTERS`, the parameter, and the `filter` argument of the
frontend's `getEntries`; the dialog calls it with the list alone. Two API
tests that used `filter=missing` pick the missing issues from the entries
as the dialog's Missing filter does. The dangling-row test drops its
filtered call, since its check that every entry has a comic already covers
it.

Test: a GET with a stray `filter` (review, missing, hidden, all, bogus)
returns the same body as one without, hidden entry included. It failed on
the old view for review, missing and hidden.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* D: comics are no longer POSTed to a list's entries

AJ's ruling on the review's recommendation: remove it before release.
`POST <pk>/entries` was new in 2.8.0 and nothing called it. The web UI adds
comics through `PATCH items`, and an ordinary API key cannot reach
`/api/v4`. The route stays because the entries GET serves it. A POST there
now answers 405.

Removed: the view's `post` method. It had no serializer. `add_comics`
stays: the list create and `PATCH items` call it. Neither passes its
`position` argument, and no other caller does now, so only a test uses it;
the argument is left as it is.

Tests:
- The add tests go through `PATCH items` instead: a comic already held is
  not added twice, and a series comic added by hand leaves the block.
- The one-step reorder test adds its comic the same way.
- The insert-inside-a-block test calls `add_comics` with its position
  directly.
- The personal-list helper creates the list holding both comics in order.
- New: a POST to the entries route answers 405 and adds nothing. It got
  200 from the old view.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A codex Series is a name, a comicbox series is one volume run, and the
importer folded every volume's start year into one Series.start_year,
which comic_references stamped on every comic. comicbox treats a start
year as the volume's identity, so Batman (2011) #1 read as a 1940-volume
comic and every later volume went missing.

- Volume.start_year, fed by the importer from each comic's
  series.start_year (earliest in a batch, last non-null across batches,
  as for the series). comic_references uses it, and gives series ids only
  for a series with one volume.
- Migration 0062: backfill a series' only volume; rewrite codex-built
  references by the three rules (a year-like volume that contradicts the
  start year; a linked hand or tagged entry takes its volume's year; an
  unlinked one loses a same-named multi-volume series' year), dropping
  folded series ids; clear non-manual name, mapping and series-id matches
  in multi-volume series; mark a one-time re-read pending.
- The librarian, at its first start after 0062, force-reads the lowest
  live comic of each yearless volume of a multi-volume series and queues
  a full rematch. An import that changes a volume's start year now queues
  a rematch too, since such a re-read changes no comic row.
- Restore unfolds references from a dump made before 0062.
- Matcher: review flag when the best comics' volumes conflict (comicbox's
  any_conflict); the mapping and series-id tiers look per volume, keep the
  volumes that agree with the entry, then those of its cover year (exact,
  then within one), and flag review when conflicting volumes remain.
  series_key uses comicbox's discriminators.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
#1055)

Uses comicbox's MatchResult.refused and per-kind name keys (comicbox PR
285, unreleased; the pin ~=5.7.1 does not resolve from PyPI yet).

- An entry the matcher leaves missing keeps its likeliest refused comic
  as ReadingListEntry.suggested_comic (migration 0063) and is flagged for
  review: another volume's issue of its cover year first, then a cover
  year more than one off; live before pending delete, then lowest pk.
  Combine, the hand-entry heal and rematch store it; a found comic or a
  person's pick clears it.
- Edit Issues shows "Missing · maybe <comic>" with Use. The suggestion is
  shown only when the viewer may see that comic: a missing entry is seen
  by everyone who sees the list. Accept All Best Guesses takes matched
  guesses only and says why it is off when only suggestions are left.
- The overlay assigns a hand edit by a shared key only when the volumes
  do not conflict: the new volume key is shared by X-Men (1963) v1 #1 and
  X-Men (1991) v1 #1, as comicbox's entry_keys now documents.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…1056)

django-allauth 65.23.0's complete_login calls
sociallogin.provider._on_login_processed() after every login, the hook
its openid_connect provider uses to track sessions for the new
back-channel logout. allauth's callback builds the SocialLogin with
provider=..., but the test fixture left it out, so all ten login-flow
tests died on None._on_login_processed. Codex's own code never builds a
SocialLogin, so only the fixture changes.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Fold migration 0063 into 0062 as 0062_volume_start_year_and_suggested_comic

Neither has shipped (v2.8.0 ends at 0061), so v2.8.1 adds one migration.
A rename-fold without `replaces`, as the repo does (#909).

Verified with empty scratch databases: migrating through the old chain and
the fold gives identical sqlite_master and codex_timestamp rows; rolling
the fold back to 0061 matches a database built only to 0061; migrating
forward again matches. A dev database that applied the old 0062 and 0063
fails with "duplicate column name: start_year" until
`migrate codex 0062_volume_start_year_and_suggested_comic --fake`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* NEWS: v2.8.1 requires comicbox 5.7.1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…docs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Split _entry, ListMatcher._pick, unfold_reference and the stored-id
resume test into small helpers; behavior unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The Add Reading Lists dialog sent every picked list in one preview
request, and the server fetches and matches each list before it
answers. With dozens of lists the request outlasted the idle timeout
of a proxy or browser in front of Codex (often 60s): the button reset
while the server kept fetching. 34 lists previewed, 63 did not.

The dialog now sends five lists per request, one request at a time,
shows "Previewed N of M lists…" while it works, and stops asking for
more when it is closed.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Update stale file/line references for _PermissionClass, format_suffix,
Literal and ManyToManyRel to where the flagged names live now.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ajslater
ajslater merged commit 3dc1318 into main Nov 27, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants