Skip to content

E2: remove classes that restate an existing declaration - #1220

Merged
trissim merged 6 commits into
mainfrom
refactor/E2-restated-declarations
Oct 12, 2026
Merged

trissim merged 6 commits into
mainfrom
refactor/E2-restated-declarations

Conversation

@trissim

@trissim trissim commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Surface E2 of the consolidation refactor: remove classes that restate what an existing declaration already says. Surface file: docs/refactor/consolidation-20261009/E2-restated-declarations.md (first commit).

E2 · PR #1220 · guards 4/4 · production −251 +148 · tests −65 +281

What changed

  • Document field names come from the dataclass. ConfigDocumentField, PipelineDocumentField (and its module) and FunctionStepDocumentField are deleted. A saved .py document is a dataclass that inherits pycodify's new SourceDocument: each constructor field is one module-level assignment. PipelineStepsDocument, PipelineDocument(PipelineStepsDocument), FunctionStepDocument and the new ConfigDocument are the four kinds; the three codecs keep only type checks and step normalization. Library PR: SourceDocument: a dataclass saved as one module of assignments pycodify#5 (no version bump; the submodule points at its branch).
  • McpReconnectOwner deleted: reconnect_owner, reconnect_required and retry_after_reconnect are properties of restart_required. The wire value "mcp_client" is unchanged.
  • RuntimeBatchCallableMetadataField (and the unused RUNTIME_BATCH_EXECUTORS_ATTR) → one private constant.
  • CellProfilerSpreadsheetRowField deleted: the row key is CellProfilerMeasurementDialect.row_identity_contract.sample_number_field.
  • ConfigFieldRequirementLabel, ConfigFieldResolutionLabel deleted: the context section formats the two booleans.
  • Rule 1b renames: ConfigDocumentAuthority → ConfigDocumentCodec, PipelineDocument.original_source → source_text.

Kept as external spellings (one line each in the surface file): McpWireContentType (MCP content blocks), DesktopInstallerSchemaVersion (installer scripts), SaveImagesImageKind and AlignModule.AdditionalMode (.cppipe settings), PlateInspectionWorkflowScope (MCP result schema). ConfigFieldSchema is an MCP result DTO derived from dataclasses.fields. The two Annotated field-role markers are reassigned to K3.

Behaviour changes

  • A complete pipeline file now writes pipeline_steps before pipeline_config (dataclass fields are ordered base first). Names and values are unchanged; files in either order load.
  • Error text for a missing assignment names the document class (PipelineDocument source must define 'pipeline_steps'.).

Deletion certificates

All derived or unused (listed in the surface file). No tests-only deletion.

Verification

All local, repo .venv (Python 3.12), offscreen, at aa7300926 (main merged):

  • guardrails_local.sh: ratchet openhcs/scripts/benchmark exit 0, 38 passed, nra-r1 exit 0, guardrails rc=0.
  • SMOKE_SKIP_GUI=1 smoke_local.sh: 5 passed, smoke rc=0.
  • Round trip (tests/unit/test_source_documents.py, four document kinds × clean/full mode), E2 guards, MCP tool contract, E1 enum guard, L6 codegen guard: 27 passed. The MCP contract test passes unchanged.
  • pycodify tests: 71 passed.
  • 84 test files that use the changed code (-n 2): 2967 passed, 11 failed. Seven are cross-file pollution in a shared worker (a CellProfiler probe module registered by another test file) and pass when their files run alone. The other four fail the same way on origin/main in the same environment: test_installed_mcp_demo.py::test_portable_source_normalization_defers_catalog_and_execution_runtimes, two test_mcp_server.py stdio tests (initialize timeout), and one test_ui_agent_bridge.py IPC test (endpoint startup timeout).
  • official30 parity under flock: first run 28/30, the two failures being OpenHCS ZMQ compilation failed: cannot import name ... (/home/ts/code/projects/openhcs/openhcs/domains/microscopy/config.py), i.e. the client attached to an execution server running the main checkout, not this branch (B7's collision). Second run: 1 passed (30/30) in 667 s.
  • The full unit suite was not run (central verification).

🤖 Generated with Claude Code

trissim and others added 4 commits October 12, 2026 01:07
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…; one-member enums

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ved or deleted

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 12, 2026 06:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

trissim and others added 2 commits October 12, 2026 03:21
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trissim
trissim merged commit 4ebec66 into main Oct 12, 2026
0 of 3 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