You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(contracts): move runtime-fact exports into their own manifest #1418
implementations/python/packages/raes_contracts/contracts/_exports.py is 499 lines. Files under implementations/python/packages are capped at 500 lines (tools/policy/adr_policy.yamloversized_source_files), and tools/policy/oversized_allowlist.yaml is empty and may only shrink. Publishing another contract family through the raes_contracts.contracts facade adds one import and one spread entry to this manifest. The inject-trigger and occurrence contracts for #1366 would therefore take the file to 501 lines and fail the repository policy.
Earlier families avoided the cap by keeping their names in their own manifest modules: _backend_operation_exports.py (#1388), _mixed_composition_exports.py (#1336) and _execution_policy_exports.py (#1413).
Existing Surface Audit
_exports.py lines 420–437 hold one contiguous family: RUNTIME_FACT_BINDING_PLANE_V1_SCHEMA_VERSION and the 17 RuntimeFact* names defined in contracts/runtime_facts.py. No other family member sits elsewhere in the manifest.
contracts/__init__.py imports these symbols explicitly from .runtime_facts and ._version_exports. It does not need to change.
implementations/python/tests/test_contracts_facade_exports.py requires contracts.__all__ == PUBLIC_EXPORTS, unique names, and a resolvable attribute for every name. test_conformance_facade_parity.py checks the facade's exported set.
The API reference documents individual modules with automodule, not the facade's __all__.
Add _exports.py to the oversized allowlist: rejected, because the allowlist may only shrink.
Move the contiguous runtime-fact family into _runtime_fact_exports.py and spread it at the same position: selected.
Chosen Architecture
Add _runtime_fact_exports.py defining RUNTIME_FACT_EXPORTS with the same 18 names in the same order, following _mixed_composition_exports.py. _exports.py imports it and spreads it where the names were. PUBLIC_EXPORTS keeps identical membership and order, so no public name, schema, fixture or runtime behavior changes. _exports.py drops to 483 lines.
Verification Plan
Compare PUBLIC_EXPORTS before and after the change for identical order and membership.
Run test_contracts_facade_exports.py and test_conformance_facade_parity.py.
Gap Claim
implementations/python/packages/raes_contracts/contracts/_exports.pyis 499 lines. Files underimplementations/python/packagesare capped at 500 lines (tools/policy/adr_policy.yamloversized_source_files), andtools/policy/oversized_allowlist.yamlis empty and may only shrink. Publishing another contract family through theraes_contracts.contractsfacade adds one import and one spread entry to this manifest. The inject-trigger and occurrence contracts for #1366 would therefore take the file to 501 lines and fail the repository policy.Earlier families avoided the cap by keeping their names in their own manifest modules:
_backend_operation_exports.py(#1388),_mixed_composition_exports.py(#1336) and_execution_policy_exports.py(#1413).Existing Surface Audit
_exports.pylines 420–437 hold one contiguous family:RUNTIME_FACT_BINDING_PLANE_V1_SCHEMA_VERSIONand the 17RuntimeFact*names defined incontracts/runtime_facts.py. No other family member sits elsewhere in the manifest.contracts/__init__.pyimports these symbols explicitly from.runtime_factsand._version_exports. It does not need to change.implementations/python/tests/test_contracts_facade_exports.pyrequirescontracts.__all__ == PUBLIC_EXPORTS, unique names, and a resolvable attribute for every name.test_conformance_facade_parity.pychecks the facade's exported set.automodule, not the facade's__all__.Alternatives
_backend_operation_exports.py: rejected, because it mixes unrelated families._exports.pyto the oversized allowlist: rejected, because the allowlist may only shrink._runtime_fact_exports.pyand spread it at the same position: selected.Chosen Architecture
Add
_runtime_fact_exports.pydefiningRUNTIME_FACT_EXPORTSwith the same 18 names in the same order, following_mixed_composition_exports.py._exports.pyimports it and spreads it where the names were.PUBLIC_EXPORTSkeeps identical membership and order, so no public name, schema, fixture or runtime behavior changes._exports.pydrops to 483 lines.Verification Plan
PUBLIC_EXPORTSbefore and after the change for identical order and membership.test_contracts_facade_exports.pyandtest_conformance_facade_parity.py.origin/dev.