Skip to content

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
mainfrom
cloud/mod-X09-party-reads-calendar-tasks
Open

rubenvdlinde wants to merge 3 commits into
mainfrom
cloud/mod-X09-party-reads-calendar-tasks

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

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

  • Example-set rows read objects through the Kernel object layer. ExampleSetAuditEntries, ExampleSetGrants, ExampleSetDeckCards, ExampleSetEmailLinks and ExampleSetTalkConversations (Configuration) called the Processes PartyService::findUnscoped only to read an object with rbac and multitenancy off. They now call one protected helper on their shared base class ExampleSetEngineRows::objectOfRow(), which does the same read on the Kernel ObjectOperationsInterface: 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. ObjectOperationsInterface is the same shared ObjectService that PartyService wrapped.
  • The import takes calendar tasks as the Kernel contract. ImportHandler::setTaskService() now takes ?ObjectCalendarTasksInterface (a wider parameter type; TaskService already implements it), and ConfigurationServiceRegistrar resolves ObjectCalendarTasksInterface::class. In ContractBindings, that contract is a registerServiceAlias of TaskService, so the import gets the same shared instance as before. The unused use ...\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.php
  • ImportHandler.php -> Service/TaskService.php
  • ExampleSetAuditEntries.php, ExampleSetDeckCards.php, ExampleSetEmailLinks.php, ExampleSetGrants.php, ExampleSetTalkConversations.php -> Service/Party/PartyService.php

They 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 e158c36a and on this branch)

Area before after diff
Kernel 6,027 6,027 0
Core 35,024 35,024 0
Notifications 1,760 1,760 0
Search 1,349 1,349 0
Compliance 14,300 14,300 0
Files 1,263 1,263 0
Integrations 17,689 17,689 0
Processes 27,041 27,041 0
Configuration 874 873 -1 (an import line removed from the exposed ConfigurationServiceRegistrar)
Platform 0 0 0
Total 105,327 105,326 -1

Expected −630 in Processes; measured 0. PartyService and TaskService are still named by files outside Processes that this package does not own:

  • PartyService: ExampleSetParties, ExampleSetCasePlans and ExampleSetAppointments (package X62 / P-example-sets-ab, round 7), Notifications/Service/ExampleSet/ExampleSetTimelineEntries (X06, per the package note), and Service/ContractBindings.php.
  • TaskService: only Service/ContractBindings.php (ObjectCalendarTasksInterface => TaskService).

ContractBindings.php belongs to X08 (PC-map) in this round. X08 moves the Processes bindings into ProcessesServiceBindings, so I did not touch it. When X08 and X62 land, and the timeline entries stop naming PartyService, 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.Configuration 874 → 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 from PartyService / TaskService mocks to the contracts. The diff is about 150 lines. No csv row changes, because no file was added.

Tests

  • Retargeted to the contracts: ExampleSetTestCase (adds an ObjectOperationsInterface fake that finds objects only with rbac and multitenancy off; the PartyService fake stays for the three rows of X62), ExampleSetEmailLinksBehaviourTest, ExampleSetDeckCardsBehaviourTest, ExampleSetGrantsWriteTest, ExampleSetTalkConversationsBehaviourTest (these now assert find(uuid, …, false, false)), ExampleSetTalkConversationsGoldenTest, ImportHandlerSeedRelatedItemsTest, ImportHandlerRelatedItemsGoldenTest and ConfigurationServiceRegistrarWiringTest (the requested id is now ObjectCalendarTasksInterface).
  • The Talk golden fixture is unchanged. It records findUnscoped only for a read with rbac and multitenancy both off.
  • New: ExampleSetEmailLinksBehaviourTest::testABlankObjectIsNotRead and testAFailedReadCountsAsNoObject, which pin render: false and audit: false.
  • A18InterfaceBindingsTest: the kept callers of PartyService drop the five files.

What ran

  • php -l on the changed files: clean.
  • vendor/bin/phpstan analyse --no-progress on 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/phpcs on the changed lib files: 1 error and 6 warnings, identical to main.
  • vendor/bin/psalm --no-cache on the changed lib files: 3 errors, all on old lines of ImportHandler.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 --report file, which this checkout does not have.
  • vendor/bin/phpunit -c phpunit.xml --no-coverage tests/Unit/Architecture: OK (2378 tests), after git merge origin/main.
  • tests/Unit/Service/ExampleSet and tests/Unit/Service/Configuration: OK (2592 tests, 1 skipped), after the merge.
  • All of 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

…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
@rubenvdlinde
rubenvdlinde requested a review from a team as a code owner November 21, 2026 18:51

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant