Skip to content

[codex] Expose CycleAwareCircuit hierarchical Design accessor#64

Draft
zhoubot wants to merge 1 commit into
mainfrom
codex/pycircuit-issue-57
Draft

[codex] Expose CycleAwareCircuit hierarchical Design accessor#64
zhoubot wants to merge 1 commit into
mainfrom
codex/pycircuit-issue-57

Conversation

@zhoubot
Copy link
Copy Markdown
Collaborator

@zhoubot zhoubot commented May 11, 2026

Summary

Closes #57.

Adds a public CycleAwareCircuit.hierarchical_design property so downstream hierarchical integrations can read the compiled Design object without depending on the private _v5_design field. Flat circuits return None.

Validation

  • PYTHONPATH=compiler/frontend pytest -q tests/unit/test_v5_state_signal.py

Downstream hierarchical build integrations need the compiled Design object, but reaching into _v5_design couples them to a private implementation field. CycleAwareCircuit now exposes a read-only public property that returns the hierarchical Design when present and None for flat circuits.

Constraint: The accessor must not create or mutate hierarchy state.

Rejected: Keep downstream code on _v5_design | that preserves a private API dependency in integration flows.

Confidence: high

Scope-risk: narrow

Tested: PYTHONPATH=compiler/frontend pytest -q tests/unit/test_v5_state_signal.py
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new hierarchical_design property to the CycleAwareCircuit class, providing public access to the underlying design object for hierarchical circuits while returning None for flat ones. This change allows downstream integrations to access the design without depending on private implementation fields. Unit tests have been added to verify this behavior in both scenarios. I have no feedback to provide as no review comments were present.

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.

Expose public accessor for CycleAwareCircuit hierarchical Design

1 participant