Skip to content

Fix what a whole-repo code review found; release 1.10.1 - #30

Draft
sminot wants to merge 2 commits into
mainfrom
claude/checkup-fixes
Draft

sminot wants to merge 2 commits into
mainfrom
claude/checkup-fixes

Conversation

@sminot

@sminot sminot commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

A whole-repo review (bugs, security, architecture, duplication, readability, imports) found 79 issues; this fixes the 21 rated critical or important that had a clear fix.

Security

  • A loaded checkpoint's SVG figure is sanitised (allowlist, packages/viewer/src/lib/sanitizeSvg.ts) before the Workspace or the viewer hands it out as a blob. The figure route sends nosniff on every figure and a CSP sandbox on SVG. Artist links in SVG figures are no longer clickable.

Sessions

  • A checkpoint with a newer app_state schema really opens read-only.
  • Save and points-transform refuse a path outside the data directory with a 400 before changing anything (it used to rename or transform, then fail).
  • A transform marks the session unsaved and bumps obsm:spatial when applied.
  • SDS_CONTAINER_MEM_MB=0 no longer refuses every load.
  • The in-process .zarr import no longer redirects the API process's stdout/stderr or root logger; its job log takes logging records from its own thread, non-propagating loggers and zarr's I/O thread. Bare prints and warnings from that import now go to the console instead.
  • Shared guards raise domain errors mapped to the same statuses and bodies; MCP no longer imports fastapi, and its save goes through the same validators (sessions/save_request.py).

Analysis Workspace frontend

  • Lasso-labelling an existing region set starts from the stored labels (this checkpoint-mode path isn't reachable from the serverless sidebar today).
  • Cirro upload toasts fire on a change, not on every page load.

Web app: five unused exports removed; reports share GroupCard and useSaveFigure; three tasks share useSpatialTask.

Needs the v1.10.1 tag after merge; all five manifests are bumped.

Checked: backend test_e2e.py (all checks passed), Workspace frontend 130 and web app 193 unit tests, typecheck, lint, build. In headless Chrome: figure headers; SVG download from the Workspace and from ?checkpoint= (identical, same elements as the source, renders); the web app's Niches, Neighborhood enrichment, Marker genes, Compare groups and Composition (kept as a report) reports run on public data, with group cards, maps and Save as a figure; Compare ran both from a column's group and from cells lassoed on the tissue (dragged and clicked, 64,893 cells either way). Not exercised: anything behind a Cirro sign-in, and an actual newer-schema checkpoint.

Also: in ?checkpoint= mode the header offered Take the lock, which posted the checkpoint's URL as a session id and 404'd; the lock badge is now left out there (checked: present on a live session, absent on a checkpoint).

🤖 Generated with Claude Code

sminot and others added 2 commits November 22, 2026 22:16
Security. A loaded checkpoint's SVG figure was served on the workspace's
origin as it came, and the viewer handed the same bytes out as a blob, so
a crafted figure opened in its own tab could run script there. Both paths
now pass SVG through an allowlist sanitiser (packages/viewer
lib/sanitizeSvg.ts), and the figure route sends nosniff on every figure
and a CSP sandbox on SVG.

Sessions. A checkpoint whose app_state is newer than the app now really
opens read-only; it only said so. A save or points-transform with a path
outside the data directory is refused with a 400 before anything changes,
where it used to rename the session or rewrite the transform and then
fail. A transform marks the session unsaved and bumps obsm:spatial when
it is applied, not when a save finishes. SDS_CONTAINER_MEM_MB=0 no longer
refuses every load.

The in-process .zarr import captured its log by swapping sys.stdout,
sys.stderr and the root logger's level for the whole API process, so
other threads' output landed in its job log and two overlapping imports
could leave the streams bound to a dead buffer. It now captures logging
records from its own thread, from non-propagating loggers, and from
zarr's I/O thread, and leaves the process streams alone.

Shared guards raise domain errors that main.py maps to the same status
codes and bodies, so the MCP tools no longer import fastapi or reverse-map
status codes. The save validators moved to sessions/save_request.py, and
the MCP save goes through them too.

Analysis Workspace frontend. Lasso-labelling a region set a checkpoint
already carries starts from the stored labels instead of erasing them
(the path is not reachable from the serverless sidebar today). Cirro
upload toasts fire on a change of state, not on every page load. The
canvas control props derive from the viewer's own interfaces.

Web app. Five unused exports are gone; the reports share GroupCard and
useSaveFigure, and three spatial tasks share useSpatialTask.

Stale comments about a tile route, a tile cache and a write lock held for
a whole job are corrected. The SPA changes need the v1.10.1 tag after
merge; the manifests are bumped to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A checkpoint opened with ?checkpoint= has no session on a server, but the
header still offered Take the lock, which posted the checkpoint's URL as a
session id and failed with a 404. The tour's lock step is optional, so it
skips there.

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

This branch has not been deployed

No deployments
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.

1 participant