Repository navigation
Remove the import cycles between _internal and the public modules - #511
Merged
Merged
Conversation
`_internal/cli.mojo` imported `morca.pipeline`, and `_internal/lakehost.mojo` and `_internal/rust_ffi.mojo` imported `morca.ctx`, all of which import `_internal`: cycles between the packages. They move, unchanged, beside the public modules that use them (`morca._cli`, `morca._lakehost`, `morca._rust_ffi`); `Ctx` and `Pipeline` keep their module paths, so registry hashes don't change. `scripts/check_layers.py` checks the layers in the customs job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017TycszSbyw92Efu4ZeCYL6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017TycszSbyw92Efu4ZeCYL6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #498
customsalready reports 0 cycles between modules on main: the cycles in #498 are between packages._internalimported three public modules that import_internalback:_internal/cli.mojo→morca.pipeline_internal/lakehost.mojo→morca.ctx_internal/rust_ffi.mojo→morca.ctx(
_internal/maintain.mojo→morca.maintain, and themorca/morca.commandimports in_internal/handover.mojoand_internal/command.mojo, are only in docstrings.)Fix: the three modules move, unchanged, out of
_internalto sit beside the public modules that use them:morca._cli(re-exported bymorcaandmorca.clias before),morca._lakehost(used bymorca.tables) andmorca._rust_ffi(used bymorca.rust_step). Imports and docstring references are updated.Ctx,Pipelineand every other public type keep their module paths, so step linkage names and registry hashes don't change:describeoutput ofexamples/toy,dailyandfanoutis byte-identical between main and this branch (toy0xa3bcc571ad7c6939, daily0x81ead348d0a21c1f, fanout0x1f0ebf1f2a93d993).Check:
scripts/check_layers.py(no dependencies) checks the package layers that customs doesn't:_commonimports only_common;_lakeonly_lakeand_common;_internalonly_internal,_lake,_commonand public modules that import no_internalmodule, directly or through others (morca.civil,morca.day, …). It runs as a step of the existingcustomsjob. On main it reports the three imports above; on this branch none. AGENTS.md's layer rule says so._internalstill imports leaf public modules (civil,day,hour,month,name,key,cron,schedule,tz,tasks): they are key and schedule types in step signatures, so they stay where they are; none of them imports_internal, so there's no cycle.🤖 Generated with Claude Code
https://claude.ai/code/session_017TycszSbyw92Efu4ZeCYL6