Repository navigation
refactor(architecture): example-set rows and the import read objects and tasks through Kernel contracts (X09) - #10995
Open
rubenvdlinde wants to merge 3 commits into
Open
rubenvdlinde wants to merge 3 commits into
rubenvdlinde wants to merge 3 commits into
Conversation
…and tasks through Kernel contracts The five example-set row kinds (audit entries, grants, Deck cards, email links, Talk conversations) read the object a row names through the Kernel ObjectOperationsInterface with rbac and multitenancy off, in one protected helper on ExampleSetEngineRows, instead of PartyService::findUnscoped. Same read (raw, no audit entry), same null on a blank uuid or a failed read, same container lookup on first use. ImportHandler::setTaskService takes the Kernel ObjectCalendarTasksInterface, which TaskService implements, and ConfigurationServiceRegistrar resolves that id; the contract is an alias of TaskService, so the same shared instance is injected. Tests keyed by PartyService / TaskService are retargeted to the contracts; the A18 kept-callers pin of PartyService drops the five files. Assisted-by: ClaudeCode:claude-opus-5-5
…nd a failed read Assisted-by: ClaudeCode:claude-opus-5-5
…eads-calendar-tasks
This branch has not been deployed
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 X09 (wave 5, round 2): party reads and calendar tasks on the existing Kernel contracts
Implements processes.md R6c (
P-example-sets-c). No new port, no new file.What changed and why it is the right dependency
ExampleSetAuditEntries,ExampleSetGrants,ExampleSetDeckCards,ExampleSetEmailLinksandExampleSetTalkConversations(Configuration) called the ProcessesPartyService::findUnscopedonly to read an object with rbac and multitenancy off. They now call one protected helper on their shared base classExampleSetEngineRows::objectOfRow(), which does the same read on the KernelObjectOperationsInterface:find(id, new ObjectFindOptions(render: false, audit: false), _rbac: false, _multitenancy: false). Behaviour is the same: the container lookup still happens first, a blank uuid still answers null without a read, and a failed read still answers null.ObjectOperationsInterfaceis the same sharedObjectServicethatPartyServicewrapped.ImportHandler::setTaskService()now takes?ObjectCalendarTasksInterface(a wider parameter type;TaskServicealready implements it), andConfigurationServiceRegistrarresolvesObjectCalendarTasksInterface::class. InContractBindings, that contract is aregisterServiceAliasofTaskService, so the import gets the same shared instance as before. The unuseduse ...\Service\TaskService;in the registrar is removed.Re-measured on fresh main first: none of these callers had landed already.
References between areas
Seven Configuration → Processes file references are gone:
ConfigurationServiceRegistrar.php -> Service/TaskService.phpImportHandler.php -> Service/TaskService.phpExampleSetAuditEntries.php,ExampleSetDeckCards.php,ExampleSetEmailLinks.php,ExampleSetGrants.php,ExampleSetTalkConversations.php -> Service/Party/PartyService.phpThey are replaced by references to Kernel (
ObjectCalendarTasksInterface,ObjectOperationsInterface,Value/ObjectFindOptions,Db/ObjectEntity).References against the order: before 37, after 37. These seven references point down the order, from Configuration to Processes, so they were never counted as against the order. No new reference against the order.
Exposed lines per area (measured on main
e158c36aand on this branch)ConfigurationServiceRegistrar)Expected −630 in Processes; measured 0.
PartyServiceandTaskServiceare still named by files outside Processes that this package does not own:PartyService:ExampleSetParties,ExampleSetCasePlansandExampleSetAppointments(package X62 / P-example-sets-ab, round 7),Notifications/Service/ExampleSet/ExampleSetTimelineEntries(X06, per the package note), andService/ContractBindings.php.TaskService: onlyService/ContractBindings.php(ObjectCalendarTasksInterface => TaskService).ContractBindings.phpbelongs to X08 (PC-map) in this round. X08 moves the Processes bindings intoProcessesServiceBindings, so I did not touch it. When X08 and X62 land, and the timeline entries stop namingPartyService, the two classes stop being exposed and the −630 shows up. This PR removes its share of the callers.Newly exposed files: none. New Kernel files: none.
Baseline
I ran
python3 tools/sig/modularity_check.py --write-baseline. The only change was in the record-only totals (exposed_loc.Configuration874 → 873,total_loc). No per-file entry changed: no exposed file and no reference against the order is gone. I did not commit the baseline, and the coordinator records it at merge.Files
The package's seven files, plus
ExampleSetEngineRows.php(the shared base class of the five rows; no other round-2 package lists it) and the tests. That makes 18 files, which is over the usual ~15. Ten of them are tests retargeted fromPartyService/TaskServicemocks to the contracts. The diff is about 150 lines. No csv row changes, because no file was added.Tests
ExampleSetTestCase(adds anObjectOperationsInterfacefake that finds objects only with rbac and multitenancy off; thePartyServicefake stays for the three rows of X62),ExampleSetEmailLinksBehaviourTest,ExampleSetDeckCardsBehaviourTest,ExampleSetGrantsWriteTest,ExampleSetTalkConversationsBehaviourTest(these now assertfind(uuid, …, false, false)),ExampleSetTalkConversationsGoldenTest,ImportHandlerSeedRelatedItemsTest,ImportHandlerRelatedItemsGoldenTestandConfigurationServiceRegistrarWiringTest(the requested id is nowObjectCalendarTasksInterface).findUnscopedonly for a read with rbac and multitenancy both off.ExampleSetEmailLinksBehaviourTest::testABlankObjectIsNotReadandtestAFailedReadCountsAsNoObject, which pinrender: falseandaudit: false.A18InterfaceBindingsTest: the kept callers ofPartyServicedrop the five files.What ran
php -lon the changed files: clean.vendor/bin/phpstan analyse --no-progresson all of lib: 38 errors, the same sorted list as on main (none in touched files). On the changed lib files alone: no errors. Composer could not download the phpstan zipballs (2.3.5, and 2.3.6 for deptrac) through the proxy, so I fetched those exact commits from github.com/phpstan/phpstan and put them in the composer files cache.vendor/bin/phpcson the changed lib files: 1 error and 6 warnings, identical to main.vendor/bin/psalm --no-cacheon the changed lib files: 3 errors, all on old lines ofImportHandler.php(lines 2305, 3562, 3587) that this PR does not touch.python3 tools/sig/modularity_check.py --check: passed (exposed 105,326, 37 references against the order).tools/sig/deptrac.sh areas --check: passed (38 class pairs, as recorded).tools/sig/rate_component_views.py: not run. It needs a--reportfile, which this checkout does not have.vendor/bin/phpunit -c phpunit.xml --no-coverage tests/Unit/Architecture: OK (2378 tests), aftergit merge origin/main.tests/Unit/Service/ExampleSetandtests/Unit/Service/Configuration: OK (2592 tests, 1 skipped), after the merge.tests/Unit, per directory, before the merge: green except for failures that fail the same way on main:Middleware/AnonymousEnvelopeReadPathsTest(4)Migration/ReservedColumnNamesTest(5)Db/AreaMapperRegistrarsTest::testEachInterfaceIsBoundOnce(translation mappers)Service/Chat/ResponseGenerationGoldenTest(5, ollama)Written with Claude Code (claude-opus-5-5)
Generated by Claude Code