Skip to content

Notebook: your masks (Stage 1, PR 16a) - #237

Merged
guijacquemet merged 2 commits into
mainfrom
claude/notebook-masks
Nov 9, 2026
Merged

guijacquemet merged 2 commits into
mainfrom
claude/notebook-masks

Conversation

@guijacquemet

@guijacquemet guijacquemet commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Stage 1 notebook PR 16a: screen 4 Your masks and the Step 3 reuse of its IDs (design notebook-natural-design-2026-11-08.md §2 "Screen 4", owner answer 4). PR 16b (screen 5 Check and save, reopen, thumbnails on screen 2, retiring the global Image type card and labels toggle) is stacked on this one.

What the screen does

  • Shown only when the folder check paired masks (or the draft already declares some), after the axis roles are confirmed (pictures are read only through them, as on Your channels).
  • One question per mask type: separate objects, each with its own number (instances) or regions: inside or outside (binary). Nothing preselected (experiment-v1 §4.5).
  • Mask ID = folder name when valid (Token rule, reserved list, object-set part in: draft_ids.id_problems("masks", …), the reader's own rules). Otherwise the box is empty and says why (nuclei-mask: E_ID_SYNTAX; cell: E_ID_RESERVED), and the user types one. Nothing is repaired.
  • Made from (optional): one toggle per declared channel label, enabled once the question is answered; saved as source_channels.
  • Evidence beside it: images with the mask (k of n), pixel type(s) from the mask headers, the number of different values in the representative image's mask plane (read with the mask step's masks.read_mask), and two pictures: the image channel (PR 13 channel_strip), and the mask reduced with the same step (preview.labels_thumbnail, never interpolated). Before an answer the mask is drawn alone in grey; after it, as declared (mask_overlay_png: outlines or tint). The mask is drawn on the channel tagged with its first made from label, else channel 1, and the caption says which.
  • A declared mask whose files are gone is listed in orange with Remove (a declared mask without files is valid, §4.5).
  • Every answer is saved at once in morphobricks.draft.json (DraftAnswers.masks); the card is a self-contained MasksCard reading and saving through the AnswerStore, like Notebook: your channels (labels first, then tag per unit) (Stage 1, PR 15) #233's cards (owner note).
  • Step 3 Describe the masks shows a Mask ID column (not described yet for an unanswered type) and no longer says "name each mask".

Library

mask_answers.py (pure): with_mask, without_mask, proposed_mask_id, mask_ids, masks_unanswered, masks_without_files, dropped_channels, drawn_on. mask_evidence.py (io): mask_evidence, representative. preview.labels_thumbnail. draft_ids kind masks. mask_text.mask_type_rows(report, ids).

Tests

tests/test_notebook_masks_screen.py (9 headless widget tests), tests/test_mask_answers.py (20 library tests), one new test in tests/test_notebook_mask_step.py (IDs reused, no "name each mask"). All fail on origin/main (the modules and the column do not exist there).

Gate (python tools/check.py, .[dev,notebook,zarr], Python 3.13): ruff check and format clean, code rules clean (no baseline grown), 4802 passed, 4 skipped (the existing case-sensitive file system and file-mode skips), and 1 failure: the embedding API pin of the new public masks_step. Fixed in 459dd02 (pinned); tests/test_embedding_api.py then passed 36/36. CI on 459dd02: all 7 jobs green.

Screenshots (rendered in Chromium from real widget state, synthetic structured images) are in the PR 16b report: pr16-02-screen4-masks-unanswered.png and pr16-03-screen4-masks-answered.png.

https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc


Generated by Claude Code

Screen 4 of the natural design: separate objects or regions, no default
(experiment-v1 4.5), the mask ID is the folder name when it is a valid
mask ID, optional made-from channels, beside the evidence (images with
the mask, dtype, values in one image, the mask drawn on the image only as
declared). Step 3's Describe the masks shows these IDs and no longer
asks to name the masks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
@guijacquemet
guijacquemet marked this pull request as ready for review November 9, 2026 05:58
@guijacquemet
guijacquemet merged commit 08181f8 into main Nov 9, 2026
7 checks passed
@guijacquemet
guijacquemet deleted the claude/notebook-masks branch November 9, 2026 06:01
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