Skip to content

L2: python-introspect is the one dataclass codec and module-surface helper - #1169

Merged
trissim merged 5 commits into
mainfrom
refactor/L2-codec-public-api
Oct 10, 2026
Merged

trissim merged 5 commits into
mainfrom
refactor/L2-codec-public-api

Conversation

@trissim

@trissim trissim commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Surface L2 (receipt: docs/refactor/consolidation-20261009/L2-codec-public-api.md). Lockstep library PR: OpenHCSDev/python-introspect#16 (python-introspect 0.2.2; this PR's submodule points at that branch, so merge #16 first).

  • openhcs/serialization/json.py and openhcs/core/public_api.py are deleted. All importers (36 + 32 production modules, plus tests, scripts, benchmark, paper and validation) import to_jsonable, JsonValue/JsonObject/JsonScalar and the public-name helpers from python_introspect. Re-exports through agent.dto, agent.dto.common and mcp.dev_client are removed.
  • AgentDtoJsonCodec (ui_bridge_transport, 99 lines) and DebugJsonCodec (core/debug) are deleted. dataclass_from_mapping is now the only decoder: wire payloads with undeclared fields fail loudly instead of being dropped silently. UI bridge contracts decode their own payload, so the decoder parameter is gone.
  • Lazy exports in agent.dto (the placeholder-swapping module class too), pyqt_gui, core.steps, benchmark and benchmark.adapters now go through lazy_exports(globals(), {owner: names}), which also produces __all__. The dead lazy layers in openhcs.core (CoreExport enum, no readers) and processing/backends/processors are deleted.
  • Pin python-introspect>=0.2.2,<0.3. This stays inside ObjectState's <0.3 bound, so ObjectState needs no change.
  • Guards: tests/unit/test_l2_codec_public_api_guards.py.

Tests: touched-test set (51 files) run on this branch and on main (bdf5b44). The failing sets are identical, except one UI-bridge test that fails only when a live bridge already occupies port 7796 on this machine; it passes when run alone. python-introspect suite: 167 passed.

L2 · PR #1169 · guards 3/3 · production −1034 +501 · tests −92 +163

🤖 Generated with Claude Code

trissim and others added 2 commits October 9, 2026 23:47
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- openhcs/serialization/json.py and openhcs/core/public_api.py are deleted;
  every importer imports to_jsonable, the Json aliases and the public-name
  helpers from python_introspect directly. The agent DTO package and
  dto.common no longer re-export the Json aliases; mcp.dev_client no longer
  re-exports to_jsonable.
- AgentDtoJsonCodec and DebugJsonCodec are deleted; dataclass_from_mapping is
  the only decoder and to_jsonable the only generic encoder. The UI bridge
  contract decodes its own payload instead of taking a decoder argument.
- Lazy package exports (agent.dto, pyqt_gui, core.steps, benchmark,
  benchmark.adapters) declare their owners through lazy_exports; the dead
  lazy layers in core, processing and processors are deleted.
- Submodule external/python-introspect -> 0.2.2 branch; pin >=0.2.2,<0.3.
- Guards in tests/unit/test_l2_codec_public_api_guards.py.

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

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 3 commits October 9, 2026 23:58
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trissim
trissim merged commit 7f39edd into main Oct 10, 2026
1 of 4 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