fix(#2137): eliminate brick import violations in portability + workflows#2445
Open
windoliver wants to merge 1 commit intodevelopfrom
Open
fix(#2137): eliminate brick import violations in portability + workflows#2445windoliver wants to merge 1 commit intodevelopfrom
windoliver wants to merge 1 commit intodevelopfrom
Conversation
Contributor
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.30.
| Benchmark suite | Current: 3ad543e | Previous: 47412c2 | Ratio |
|---|---|---|---|
tests/benchmarks/test_core_operations.py::TestBlake3HashingBenchmarks::test_hash_1mb_content |
3913.2383980397535 iter/sec (stddev: 0.000013642436781606008) |
6603.145917940173 iter/sec (stddev: 0.000007410072053980514) |
1.69 |
tests/benchmarks/test_core_operations.py::TestBlake3HashingBenchmarks::test_hash_smart_1mb_content |
21257.240097134913 iter/sec (stddev: 0.000002086379278961398) |
34099.54872660558 iter/sec (stddev: 0.0000010957338875135603) |
1.60 |
tests/benchmarks/test_service_delegation.py::TestAsyncDelegationOverhead::test_version_get_delegation |
5485.793020866285 iter/sec (stddev: 0.0027101876602690722) |
7957.539783610038 iter/sec (stddev: 0.001739169458356453) |
1.45 |
tests/benchmarks/test_service_delegation.py::TestAsyncDelegationOverhead::test_rebac_check_delegation |
6562.1958981687985 iter/sec (stddev: 0.000028986038656080825) |
9133.753611567156 iter/sec (stddev: 0.000019756552545522996) |
1.39 |
tests/benchmarks/test_service_delegation.py::TestAsyncDelegationOverhead::test_mcp_list_mounts_delegation |
6666.16669045214 iter/sec (stddev: 0.00002609898317759278) |
9260.93481431103 iter/sec (stddev: 0.000025379325687133745) |
1.39 |
tests/benchmarks/test_service_delegation.py::TestAsyncDelegationOverhead::test_oauth_list_providers_delegation |
5337.620611961275 iter/sec (stddev: 0.0030884535988339444) |
7634.806028436233 iter/sec (stddev: 0.0021415115937043604) |
1.43 |
tests/benchmarks/test_service_delegation.py::TestGatewayDelegationOverhead::test_gateway_rebac_check |
38264.95970665517 iter/sec (stddev: 0.0021237693392743614) |
55641.571970588935 iter/sec (stddev: 0.001539687675707864) |
1.45 |
This comment was automatically generated by workflow using github-action-benchmark.
Contributor
Type Safety Progress 📉Current: 419 type: ignore comments ✅ Progress! Keep eliminating type suppressions! |
The portability brick was accessing rebac_manager via getattr(self.nexus_fs, "rebac_manager", None) — a LEGO architecture violation (duck-typing into kernel internals instead of explicit DI). Changes: - Add ReBACPortabilityProtocol to contracts/portability_types.py - Accept rebac as explicit constructor kwarg in both services - Update convenience functions (export_zone_bundle, import_zone_bundle) - Update CLI zone.py to inject rebac at construction time - Update e2e permission test to pass rebac via DI
397321a to
3ad543e
Compare
Contributor
Type Safety Progress 📉Current: 418 type: ignore comments ✅ Progress! Keep eliminating type suppressions! |
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.
Summary
Stream 9 | Issue #2137 | LOW severity refactor
Eliminates all direct kernel imports from the portability and workflows bricks, enforcing LEGO architecture §3.3 brick rules (zero
nexus.core/nexus.backends/nexus.storageimports, DI via constructor Protocols).Changes
PortabilityFSProtocol,PortabilityMetadataProtocol,PortabilityBackendProtocol,ReBACPortabilityProtocolincontracts/portability_fs.py;AsyncSessionFactoryProviderincontracts/session_factory.pyZoneExportServiceandZoneImportServicenow accept Protocol-typedfs+ optionalrebacvia constructor DI instead of importingNexusFS/BackendABCdirectlyWorkflowStoreusesAsyncSessionFactoryProviderProtocol instead of importingRecordStoreABCzone.pyexport/import commands passrebac=getattr(nx, "rebac_manager", None)explicitlycreate_file_metadata()in contracts replaces runtimefrom nexus.core.metadata import FileMetadataLEGO Architecture Alignment
Brick Zero-Core-Imports CheckVerification
ruff check— cleanruff format— cleanmypy— clean (6 source files)Brick Zero-Core-Imports Checkpre-commit hook — PASSTest plan
isinstance(NexusFS, PortabilityFSProtocol) = True