Add public server_core API surface and enforce no-private-imports#402
Open
Add public server_core API surface and enforce no-private-imports#402
Conversation
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.
Motivation
server_coreinternals and provide a stable public contract grouped by concern (ingress, timeout, progress, report serialization) for clearer boundaries.server_coresymbols by adding a policy scanner rule and tests to lock the new contract surface.Description
src/gabion/server_core/command_orchestrator_primitives.py(e.g.ingress_*,timeout_*,progress_*,report_*,plan_materialize_execution_plan,deps_default_execute_command) and exported those names via__all__.src/gabion/server_core/dataflow_runtime_contract.py(e.g.PROGRESS_*,INGRESS_*,TIMEOUT_*,REPORT_*) to surface runtime contract values and callables.src/gabion/server.pyto call the new public primitives and collapsed trivial pass-through wrappers into direct alias bindings while retaining boundary-normalization and command registration responsibilities.src/gabion/cli.pyand corresponding tests to use the new public response normalization/serialization symbols instead of private imports.scripts/policy/private_symbol_import_guard.pyto detect privategabion.server_coresymbol usage via aliased module attributes and to exempt owner-module usage; added focused tests to validate detection and owner exemptions.tests/gabion/commands/test_server_core_public_api.pyand adjustments in existing CLI and policy tests to lock the new public contract and prevent regressions.Testing
PYTHONPATH=src:. python scripts/policy/policy_check.py --workflowsand--ambiguity-contract, both completed successfully.PYTHONPATH=src:. python scripts/policy/private_symbol_import_guard.py --check --out out/private_symbol_import_report.jsonand iteratively fixed findings untilnew=0(no new non-exempt private imports reported).PYTHONPATH=src:. python -m pytest -o addopts=''against the modified test files and related parity suites, and the selected test set passed (all targeted tests passed across the CLI, policy, server_core parity and new public-api tests).Codex Task