Skip to content

Draft description, proposed IDs and legacy design migration (Stage 1, PR 7) - #191

Merged
guijacquemet merged 7 commits into
mainfrom
claude/description-draft
Nov 7, 2026
Merged

guijacquemet merged 7 commits into
mainfrom
claude/description-draft

Conversation

@guijacquemet

@guijacquemet guijacquemet commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

What

Stage 1 design PR 7 (conformance P30 and the proposal part of P32). Additive: no run, notebook or CLI command uses it yet, and nothing is written to disk.

  • draft_ids: a folder label is proposed as a condition, technical-repeat or repeat ID only when the reader would accept it as written (Spec 4.6a, extended to repeat IDs as in Q6). control, files, z and the like get no proposal. Nothing is trimmed, re-cased, numbered, derived or renamed. The rules applied are the reader's own (description_identity, description_rules), with no second copy. A raw header name is proposed as a channel ID only if it is a valid ID as it stands (Q4). R, G and B are never proposed, and names equal ignoring case within one layout get no proposal.
  • draft: draft_from_discovery and Draft. IDs stay proposed until confirm_id. Open questions are listed, and a draft is not publishable while any is open. unit_rows() gives condition_id, repeat_group and technical_repeat_id beside the unchanged source labels (Q8). The draft is not a description and writes no file.
  • migrate_legacy_design: reads experiment_design.csv strictly, so yes, no and empty are refused. repeat_group is carried as the proposed repeat ID. A group with several confirmed_on dates takes the latest, and a note lists each folder's date (never the clock). A confirmed group with no date stays open. 0, 1 or 2+ marked controls give no reference, one reference per other condition, or an open question. A design that breaks a Spec rule is refused with the reader's code (found by running the reader's own phases on a probe document, for example E_REPEAT_ID_SHADOWS_SOURCE). A legacy condition such as control migrates with no proposed ID and is not refused. New folders are pending and reopen their group. Missing legacy folders block publication.
  • Owner decision (2026-11-07), Spec 4.6a: a legacy repeat_group that is not an allowed repeat ID (for example z, files, overrides) is not refused. It migrates with no proposed repeat ID and an open id_pending question, so the user names the repeat. Nothing is repaired or derived, the legacy confirmation and date are kept, and confirm_id still refuses the forbidden value unchanged (E_FORBIDDEN_FIELD). In the rule-check probe the repeat now gets a stand-in ID like conditions and technical repeats do. This replaces the earlier "refused with E_FORBIDDEN_FIELD" behaviour (commit 2 of this branch).
  • design._parse_strict is renamed parse_design_bytes (public, same behaviour).

Not decided (skipped)

  • For a forbidden condition or technical-repeat folder (control, files) the Spec says preprocessing proposes "a different ID that is allowed", but gives no rule for making one. Deriving one would be a repair, so there is no proposal. The user names the ID. P32's "never control, files, overrides" holds. The derived CSV part of P32 is PR 10.
  • Wiring raw header names into the draft needs the raw-name field of the discovery PR (Discovery and header additions for the experiment description (Stage 1, PR 6) #190, now merged). propose_channel_ids takes the names as input and is tested alone.

Part of the Stage 1 design (PR 7). Main was merged into the branch (CHANGELOG and AGENTS.md conflicts resolved by keeping both entries).

Tests

tests/test_draft.py, 35 tests. On origin/main the file fails at collection (ModuleNotFoundError: morphobricks_preprocessing.draft). Regression for the owner decision: test_a_legacy_repeat_group_that_is_not_an_allowed_id_opens_a_question[z|files|overrides]. On the previous branch tip (source reverted) it fails for all three with LegacyMigrationRefused ... (E_FORBIDDEN_FIELD); on this branch: 35 passed.

python tools/check.py after merging current main: 3879 passed, 4 skipped, code rules clean. The 4 skips are environment ones (case-insensitive file system and file-mode tests, unrelated to this change).


Generated by Claude Code

…Stage 1, PR 7)

Folder labels are proposed as condition, technical-repeat and repeat IDs, and raw header
names as channel IDs, only when the reader would accept them as written; otherwise there is
no proposal and nothing is repaired. A draft keeps IDs proposed until confirmed and lists its
open questions. migrate_legacy_design reads experiment_design.csv strictly and carries repeat
groups, the latest confirmed_on (with a note of the original dates) and the control rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
…c 4.6a)

Owner decision of 2026-11-07: migrate_legacy_design no longer refuses a
repeat_group such as z; it migrates with no proposed repeat ID and an open
question, so the user names the repeat. Nothing is repaired or derived.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm

# Conflicts:
#	pyproject.toml
@guijacquemet
guijacquemet merged commit a93854c into main Nov 7, 2026
7 checks passed
@guijacquemet
guijacquemet deleted the claude/description-draft branch November 7, 2026 18:59
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