Repository navigation
refactor(architecture): publish the five values the object values name in lib/Contract (X00 a) - #10976
Merged
Conversation
…ead values name in lib/Contract ObjectFindTarget, SaveActor, SavePolicy, BulkBatchDefaults and LockRunStep move verbatim into lib/Contract (task 7.2). Each old Kernel\Contracts\Value name stays as a deprecated final subclass with nothing of its own, so every construction, instanceof and type hint keeps working. ObjectFindTarget::fromFindOptions() builds the class it is called on (new static), so the old name still returns the old type. Assisted-by: ClaudeCode:claude-opus-5-5
This was referenced Nov 20, 2026
…#10976 Assisted-by: ClaudeCode:claude-opus-5-5
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.
Package X00, PR a of 3: the five transitive value types move into
lib/ContractWave 5, round 1, task 7.2 (published contract self-contained). This PR moves the five values that the eight
ObjectServiceInterfacevalues name in their own signatures:ObjectFindTarget,SaveActor,SavePolicy,BulkBatchDefaults,LockRunStep.What moved and why
lib/Contract/<X>.phpfor each of the five: the class body verbatim (constructor, promoted readonly properties, methods, docblocks). Three changes only, as the package says: the class is no longerfinal;ObjectFindTarget::fromFindOptions()buildsnew static(...)(return typestatic, with@phpstan-consistent-constructor/@psalm-consistent-constructor), so calling it on the old name still returns the old type; type hints on other promoted types follow in PR b (fromFindOptions()still takes the KernelObjectFindOptionsuntil that one is promoted).lib/Kernel/Contracts/Value/<X>.phpkeeps its name and becomesfinal class X extends \OCA\OpenRegister\Contract\X {},@deprecatednaming the new class. Every construction (positional or named),instanceofand type hint on the old name keeps working. Noclass_alias.lib/Contract/counts to Kernel through its existing directory row (Contract/,,Contract,,,,,Kernel), soscripts/component-map.csvand the generated files do not change.ContractIsALeafTest::PUBLISHEDlists the five new published files.Nothing in
lib/Servicechanges in this PR; no caller changes.Re-measured on fresh
origin/main(c3d2067b)#10852, #10859 and #10929 (the open PRs the package named) are merged. No earlier X00 PR exists. None of the five types was in
lib/Contractyet.Exposed lines per area (
measure()['exposed_loc'])Expected by the package: about +65 for all 13 stubs. Measured −47 for these five: the code lines moved to
lib/Contract/, which only the Kernel stubs name so far (same area, not exposed); the stubs that other areas name are a few lines each.Functional view (
rate_component_views.py, view C): unchanged, independence 1.42, entanglement 5.32, modularity 3.94.References against the order
56 before, 56 after (
modularity_check.py).Newly exposed files / new Kernel files
modularity_check.py --checkreports exactly five new Kernel files and nothing else:lib/Contract/BulkBatchDefaults.php,lib/Contract/LockRunStep.php,lib/Contract/ObjectFindTarget.php,lib/Contract/SaveActor.php,lib/Contract/SavePolicy.php: the published contract decided in task 7.2 (Ruben, 2026-11-20). They are deliberate: the publishedObjectServiceInterfacereaches them through its values, and leaf apps can only load whatlib/Contract(and its copy inhydra-gates/contracts/) holds.No newly exposed file.
Gate 67
The
hydra-gates/contracts/copy in ConductionNL/.github gets these files in the companion PR opened with PR c (it carries all 13 files and the changedObjectServiceInterface.phpat once, byte-identical). This PR is not mergeable before that .github PR; land the .github PR first, or land a, b and c together after it.Gate 67 on main today (runner and contracts from
.github@main, againstorigin/main'slib/Contract), before this package: already FAIL —ObjectFileReaderInterface.phpis not shipped inhydra-gates/contracts/, andObjectServiceInterface.phpdiffers (the shipped copy predates the value-object signatures). Not fixed here (ObjectFileReaderInterfaceis out of scope per the package;ObjectServiceInterfaceis replaced by the companion PR).What ran
php -lon the 10 changed lib files: clean.vendor/bin/phpcson them: clean.vendor/bin/phpstan analyse --no-progresson them andlib/Service/ObjectService.php(thefromFindOptionscaller):[OK] No errors, exit 0.vendor/bin/psalm --no-cacheon them: no errors.python3 tools/sig/modularity_check.py --check: only the five deliberate new Kernel files above; no new reference against the order.tools/sig/deptrac.sh areas --check: no new violating pair from this PR. It reports 2 "new" pairs (ObjectSourceWiring -> CalendarEventService,RenderObject -> WatcherService) that it reports identically onorigin/mainwithout this change (stale baseline, not this PR).vendor/bin/phpunit -c phpunit.xml --no-coverage tests/Unit/Architecture: 2371 tests; the only failure before the test update wasContractIsALeafTest::testContractHoldsOnlyThePublishedFiles(the list now names the five files);ContractIsALeafTestand the new test pass.tests/Unit/Contract/PromotedValueTypesTest.php(new) +ContractIsALeafTest: OK (22 tests, 61 assertions).AnonymousEnvelopeReadPathsTest, which fails identically onorigin/main(ObjectsControllerFactory::args()TypeError, not this PR).Order
PR a → PR b (stacked on this branch) → PR c (stacked on b). The .github companion PR lands first.
Written with Claude Code (claude-opus-5-5)
Generated by Claude Code