architecture: canonicalize runtime profile and contract foundation - #173
Open
rickisba wants to merge 1 commit into
Open
architecture: canonicalize runtime profile and contract foundation#173rickisba wants to merge 1 commit into
rickisba wants to merge 1 commit into
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
RuntimeProfileand KDN v1 contract primitives so other services can depend on stable, wheel-installable modules.kdn_server.contractsandkdn_server.domainwhile surfacing the canonical objects undercacheroute.*.Description
src/cacheroute/runtime/profiles.pyandsrc/cacheroute/runtime/__init__.pycontaining the canonicalRuntimeProfile(values,normalize,resolve_startup, andresolve_auto) that delegates normalization tocacheroute.compat.runtime.normalize_runtime_profile.src/cacheroute/contracts/v1/common.py,src/cacheroute/contracts/v1/errors.py,src/cacheroute/contracts/v1/__init__.py, andsrc/cacheroute/contracts/__init__.pyimplementing the canonical KDN v1 contract foundation (constants,SupportState,ContractModel,VersionedMessage,GatewayTargetedRequest,TokenReference,TokenInput,OutcomeCode, andContractErroralias) with preserved wire values and validation behavior.kdn_server/contracts/common.pyandkdn_server/contracts/errors.pyinto import-only forwarding shims that re-export the canonical objects fromcacheroute.contracts.v1, and updated KDN modules to import the canonical contracts and runtime profile instead of local duplicates (production imports were updated where required, e.g. gateway and cache-service contract references).kdn_server/domain/models.pyto importRuntimeProfilefromcacheroute.runtimeand removed the duplicateRuntimeProfiledefinition from that file.pyproject.tomlexplicit setuptools package list to includecacheroute.runtime,cacheroute.contracts, andcacheroute.contracts.v1while keeping transitional packages.test/test_contract_foundation.pyand adjustments to existing governance/namespace tests to assert canonical/legacy identity, serialization/validation parity, shim-only modules, support-state truthiness, outcome wire values, and dependency-light import isolation.kdn_server.contracts(they now import the canonical foundation); no migration ofknowledge.pyorcache_service.pyimplementations beyond updating imports.Testing
python3 -m compileall -q src kdn_server testcompleted successfully.python3 -m pytest -q test/test_repository_governance.pypassed (8 passed).pydantic(and other heavy deps) were not available in the environment rather than due to forbidden dependency imports.test/test_contract_foundation.pyand related suites was blocked by missing test dependencies (pydantic,numpy) and by package-index/network restrictions (HTTP 403) which prevented installing requirements and building wheels in this environment.cacheroute.runtimepassed (no forbidden modules loaded when importing canonical packages from an isolated process).setuptools.build_metaand other build-time dependencies were unavailable due to the blocked package index, so wheel path/size and isolated-install assertions are not available from this run.Closes #172
Refs #159
Refs #157
Codex Task