Skip to content

[access] refactor(independence): hide the K25 controllers, BSN format, push channels and context-chat listener behind their components - #7503

Merged
rubenvdlinde merged 5 commits into
mainfrom
cloud/k25-independence
Nov 9, 2026
Merged

rubenvdlinde merged 5 commits into
mainfrom
cloud/k25-independence

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Lane K25, round 10c: component independence for the K25 classes. The interfacing targets were already met at the start (over-4 params 9, target 9; over-6 params 0, target 0).

What changed

  • CaseTokenController, AnalyticsSeriesController (lib/Controller): their hand-wired entries in BuiltinIntegrationServices are gone, and the container now autowires both controllers. Their service dependencies were already typed against interfaces bound in ContractBindings, so each resolves to the same shared service instance. AnalyticsSeriesController now takes its app id from AppIdentity::APP_ID (brief step 2). The factory-table tests lose those two entries.
  • BsnFormat (lib/Formats): NlPatternSet now types the elfproef as Opis' Format. Its default instance comes from IdentifierFormats::bsn(), a new factory inside lib/Formats. new NlPatternSet() behaves as before.
  • PushEvents (lib/Push): the channel names moved to a new constants interface, PushChannels. PushEvents implements it, so PushEvents::OR_OBJECT and PushEvents::OR_COLLECTION still work. NotifyPushListener reads PushChannels.
  • ContentProviderRegistrationListener (lib/ContextChat): ContextChatRegistrar::registerListeners() registers it now. FlowsListenerRegistrar calls that method at the same point, so the pinned listener order is unchanged (ListenerOrderTest passes against the unchanged fixture).
  • New tests: K25InterfaceBindingsTest and IdentifierFormatsTest.

What ran (on this branch merged with current origin/development)

  • phpunit on tests/Unit/Architecture, tests/Unit/Contract, tests/Unit/Kernel, tests/Unit/Service/Rules, ControllerServicesWiringTest, ControllerSessionWiringTest, plus the tests of every touched directory (AppInfo, Service/Integration, Formats, Push, Listener, ContextChat, Service/TextExtraction, and both controller tests): OK, 4738 tests.
  • php -l on every touched file: clean. phpstan on the touched lib files: no errors. phpcs: no errors, and no new warnings. The @spec warnings that remain were already there before this change.

Numbers (lane_measure.py, lane K25)

  • Exposed LOC of the K25 target classes: 667 → 488 (target ≤ 488)
  • Over-4 params: 9 → 9 (target ≤ 9); over-6 params: 0 → 0 (target ≤ 0)

Left

  • DestructionRefusedException::__construct (5 params): it is built in lib/Service/Deletion/RetentionClockService.php, which is in open [access] refactor(db): reach the purpose, share, report and flow-claim mappers through narrow interfaces #6965.
  • These classes stay exposed because the only outside file that names them belongs to another lane or to AppInfo: RegisterCalendarProvider, ObjectReferenceProvider, OpenRegisterCloudFederationProvider, IntegrationDashboardWidget, OutboundClientFactory (all lib/AppInfo/Application.php); LogDanglingLinkedTypes (lib/Service/Integration/IntegrationWiring.php); PortalSubject (lib/Controller/PortalTaskController.php); BulkSaveOutcomes (lib/Controller/BulkController.php); MasterDataAnnotationValidators (lib/Db/SchemaMapper/AdvisoryAnnotationChecks.php).

AI disclosure: this change was made by Claude Code (an AI coding assistant) running as an automated lane.


Generated by Claude Code

…analytics-series controllers

Both controllers were hand-wired in BuiltinIntegrationServices, the only file
outside lib/Controller that named them. Their dependencies are all
container-resolvable (the service interfaces are bound in ContractBindings), so
the hand-wired entries go and the controllers autowire like every other
controller. AnalyticsSeriesController takes the app id from AppIdentity
instead of receiving it.

Assisted-by: ClaudeCode:claude-opus-5-5
NlPatternSet in lib/Files was the only file outside lib/Formats that named
BsnFormat. It now types the check as Opis' Format and gets the default from
IdentifierFormats, a factory inside lib/Formats.

Assisted-by: ClaudeCode:claude-opus-5-5
…xt-chat listener inside their components

NotifyPushListener now reads the channel names from the PushChannels interface
(PushEvents implements it, so PushEvents::OR_OBJECT keeps working). The
context-chat content-provider listener is registered by ContextChatRegistrar,
which FlowsListenerRegistrar calls at the same point, so the listener order is
unchanged.

Assisted-by: ClaudeCode:claude-opus-5-5
Assisted-by: ClaudeCode:claude-opus-5-5

Copy link
Copy Markdown
Contributor Author

Newman API Test Suite (api-test-coverage) is red, but not because of this PR.

  • The failing unit tests are JobRunMapperNarrowGolden, FileVersioningHandlerGolden, A18InterfaceBindings, TextExtractionJobsGolden, EndpointsControllerAnswersGolden, SchemaConfigValidatorsGolden and ProcessingLogServiceGolden. None of them cover a file this PR changes.
  • Locally, all 75 of those tests pass on this PR's head (7f79613), on current development, and on this branch merged with current development.
  • The same workflow has failed on every recently completed run I listed (the latest 20). That includes the Vue-only cloud/k3x-* lanes and release/v2.1.47-unstable.20261109051336. In the latest 15 runs of this workflow (all still running when I checked), the four on development itself had no result yet.

I have asked GitHub to re-run the job once. There is no fix to bring in from here: the failure appears to come from how the full suite runs in CI, since these tests pass when run on their own.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Two more red checks, and neither comes from this PR: quality / Frontend Check (test:l10n:parity) and quality / Frontend Check (format).

This PR changes only PHP files under lib/ and tests/Unit. It touches no src/ files, no l10n/ files, and no JS test files.

  • test:l10n:parity fails because a locale has lost parity: a plural form array would render blank (docs/l10n-workflow.md §7.1). That comes from locale data that is already on development.
  • format has Prettier reporting style issues in 116 files that this PR does not change, for example tests/unit/support/tableGolden.js.

There is no fix to bring into this PR. Both checks need fixing on development.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Two more frontend checks are red, and neither comes from this PR: quality / Frontend Check (test:l10n) and quality / Frontend Tests (unit). This PR changes no src/ or l10n/ files.

  • test:l10n: the repo's CLAUDE.md already records this check as red at HEAD. Keys used in src/ are missing from en.js since a development merge.
  • unit: the only failing suite is src/views/migrationPack/migrationPackTables.dom.golden.spec.js, a Vue view this PR doesn't touch. All 4945 tests that ran passed.

There is no fix to bring into this PR. Both checks need fixing on development.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Another red check that doesn't come from this PR: quality / Vue Quality (eslint). ESLint reports problems in files that already exist on development, for example scripts/l10n/casing.js and the scripts/l10n/detectors/*.js files. This PR changes only PHP files under lib/ and tests/Unit, so there is no fix to bring into it.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / PHP Quality (phpstan) is red, but not because of this PR. None of the reported errors are in a file this PR changes. They are in:

  • BackgroundJob/FileTextExtractionJob.php
  • Controller/EndpointsController.php
  • Controller/Support/RegisterStatistics.php
  • Controller/TaskNotesController.php
  • Controller/WebhooksController.php
  • Db/Tenancy/TenancyIdentityTrait.php
  • Notifications/Controller/NotesController.php
  • Search/Service/GraphQL/GraphQLService.php

I also ran phpstan locally on every file this PR touches, and it found no errors. There is no fix to bring into this PR.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / PHP Quality (psalm) and quality / PHP Quality (phpcs) are red, but not because of this PR.

  • psalm: every error is in a file this PR doesn't change, for example AppHost/ObservabilityWiring.php, Controller/CredentialController.php, Db/AuditTrail.php, Db/MagicMapper/FacetResults.php and Service/ContractBindings.php. Some are also stale baseline entries.
  • phpcs: I ran phpcs locally on every PHP file this PR touches and it reports 0 errors. The only findings are @spec warnings that were already there before this PR, and warnings don't affect the exit code.

There is no fix to bring into this PR.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / Hydra Gates is red, but not because of this PR. This was a forced full-repo run, so it judged the whole tree, not this diff. The failing gates are:

  • gate-3 stub-scan
  • gate-7 no-admin-idor
  • gate-12 nc-input-labels
  • gate-17 redundant-controller
  • gate-40 form-label-association
  • gate-46 spec-anchor-existence
  • gate-49 controller-exception-translation

Each one reports code this PR does not add or change:

  • gate-3 looks for "In a complete implementation" text, empty BackgroundJob run() bodies and Vue fetch stubs. This PR adds none of these, and it touches no BackgroundJob or Vue file.
  • gates 12 and 40 check Vue form inputs. This PR changes no Vue files.
  • gates 7, 17 and 49 judge controller method bodies. The only controller this PR touches is AnalyticsSeriesController, and only its constructor changed; no route method was touched.

There is no fix to bring into this PR.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / PHP Quality (phpmd) is red across the whole repo, and this PR adds two of its findings. phpmd reports about 617 findings in total. Two of them are new in this diff, both StaticAccess:

  • lib/Files/Service/TextExtraction/PatternSet/NlPatternSet.php:75 calls IdentifierFormats::bsn(). A constructor default can't call a factory instance, and NlPatternSet is built with new NlPatternSet() in a file this lane doesn't own, so a static factory was the narrow way to stop naming BsnFormat across the boundary.
  • lib/Listener/Registrar/FlowsListenerRegistrar.php:145 calls ContextChatRegistrar::registerListeners(). This is the same registrar-calls-registrar pattern the repo already uses everywhere, for example in ListenerRegistrar, AppHostRegistrar, ObservabilityRegistrar and IntegrationWiring. phpmd flags all of those too.

Neither finding affects behaviour. Everything else phpmd reports is in code this PR doesn't touch, so the check will stay red until development is fixed whatever happens here. If you'd rather these two be gone, a reviewer can ask for a follow-up PR. This PR is finished as opened and will get no more commits.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / Integration Tests (Newman) is red. Three assertions failed, none in a feature this PR touches.

  1. Restore endpoint responds ("18b. Restore Deleted Object"): the endpoint returned 412, where the test expects 200 or 500. That is object revert/restore, and this PR doesn't touch it.
  2. contact destruction date follows the client (openregister-dates-follow): undefined instead of '2028-10-01'. That is retention-date propagation, which this PR also doesn't touch.
  3. notify-on-change: no step failed (flow examples): a flow step failed with The call to source "1a390fe7-…". That is flow source calls, also untouched here.

This PR changes only container wiring for CaseTokenController and AnalyticsSeriesController, the BSN check behind an interface, the push channel constants, and where the context-chat listener is registered. None of the three failing requests goes through that code.

I found no other run of this job to compare against: none of the 15 most recent completed runs of this workflow on other branches included it. There is no fix for these three that belongs in this PR.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

quality / PHPUnit (PHP 8.3, NC stable35, pgsql) is red. The 6 errors and 4 failures are not from this PR.

They are in FileVersioningHandlerGoldenTest (6 errors), SchemaConfigValidatorsGoldenTest (1 failure) and ProcessingLogServiceGoldenTest (3 failures). They are the same tests, in the same three classes, that failed in the Newman unit stage above, and none of them covers code this PR changes. Locally, all of them pass on this PR's head and on current development when run on their own.

Separately, the run reports 4,354 risky tests: tests that execute code their @covers/@uses tags don't list. Risky tests do not fail the job. Three of them come from this PR, and I'm flagging them because they come from this diff:

  • IdentifierFormatsTest runs BsnFormat, which is not listed.
  • ListenerOrderTest now runs ContextChatRegistrar, which is not listed.
  • BsnDetectionTest now runs IdentifierFormats, which is not listed.

The first is a missing @uses in a test this PR added. The other two come from the delegation and factory this PR introduces. A follow-up PR can add the missing @uses tags. This PR is finished as opened and gets no more commits.


Generated by Claude Code

@rubenvdlinde
rubenvdlinde merged commit 22abe46 into main Nov 9, 2026
36 of 51 checks passed
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openregister @ dc5d182

Check PHP Vue Security License Tests
lint ✅
phpcs ❌
phpmd ❌
psalm ❌
phpstan ❌
phpmetrics ✅
eslint ❌
stylelint ✅
build ✅
check-specs ✅
test-l10n ❌
test-l10n-parity ❌
format ❌
check-schema-l10n ✅
test-coverage-ratchet ✅
composer ✅ ✅ 168/168
npm ✅ ✅ 641/641
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ❌ 49038/49048 · 19 skipped
Newman ❌ 1625/1628
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ❌

Quality workflow — 2026-11-09 12:06 UTC

Download the full PDF report from the workflow artifacts.

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.

2 participants