Skip to content

[access] refactor(object): freeze, file store and facet/archive constructors take request objects and bundles - #7567

Merged
rubenvdlinde merged 1 commit into
mainfrom
cloud/k18-object-handlers
Nov 9, 2026
Merged

rubenvdlinde merged 1 commit into
mainfrom
cloud/k18-object-handlers

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

What changed

Interfacing work (SIG unit interfacing, > 4 parameter band) on three object handlers. Lane K18, round 10c.

  • ArchiveHandler::freeze(identifier, reason, state, register, schema) → freeze(ObjectStateRequest $request, ?string $state = null). The method already built that request and forwarded it to a private freezeRequested(). That method is now folded into freeze, and ObjectStateController builds the request. The interface follows.
  • ArchiveHandler::__construct (5 → 4): the object lookup, the update gate (PermissionEnforcementInterface) and the user session stay as direct parameters. The audit trail and logger move into a new ObjectStateRecording bundle.
  • FacetHandler::__construct (5 → 4): the object and schema mappers move into a new FacetLookups bundle. The property-read guard stays a direct parameter, still last and nullable.
  • FilePropertyHandler::processSingleFileProperty(objectEntity, fileInput, propertyName, fileConfig, index) → (FileStoreRequest $request, $fileInput). It already built that request on its first line. Its only production caller, storeFile, builds it now. The file stays non-strict, as it was.

Access outcomes are unchanged. The archive transition and move-guard goldens pin both allowed and refused outcomes, and they pass. As a mutation check, removing the update permission check makes 5 of them fail.

Tests change only where they build these classes or pin the old call shape, with the same values. That includes the freeze expectation in tests/Unit/Contract/FrozenFileWriteContractTest.php, which now expects the equivalent request object: it is not weakened. The HTTP route that the contract really protects is untouched.

What ran

On this branch merged with current origin/development, together with the lane's other branch:

  • tests/Unit/Architecture, tests/Unit/Contract, tests/Unit/Kernel, tests/Unit/Service/Rules, ControllerServicesWiringTest, ControllerSessionWiringTest, tests/Unit/Service/Object, tests/Unit/Controller: all green.
  • php -l, phpcs (only the pre-existing missing-@SPEC warnings) and phpstan on the touched files: clean.

Numbers (lane_measure.py, K18)

  • Before: > 4 band 322 LOC, > 6 band 39 LOC.
  • After, with both K18 branches merged: > 4 band 128 (target 137), > 6 band 0.
  • This PR covers freeze (12), FilePropertyHandler::processSingleFileProperty (10), the ArchiveHandler constructor (8) and the FacetHandler constructor (8).
  • UpsertOnKeyHandler::upsert (4) is left as is: its only caller, ObjectsController, is held by an open PR outside this round.

Written with AI assistance (Claude Code).


Generated by Claude Code

…uest objects; two constructors bundled

ArchiveHandler::freeze(identifier, reason, state, register, schema) now takes
the ObjectStateRequest it already built (plus the state), and the private
freezeRequested it forwarded to is folded in. ObjectStateController builds
the request. The constructor keeps the object lookup, the update gate and
the user session direct and takes the audit trail and log as
ObjectStateRecording. Allowed and refused outcomes are unchanged: the
transition and move-guard goldens pass, and removing the update check makes
five of them fail.

FacetHandler takes its object and schema lookups as FacetLookups; the
property-read guard stays a direct, last, nullable parameter.

FilePropertyHandler::processSingleFileProperty takes the FileStoreRequest it
already built and the file input.

Tests that build these classes or pin the call shape (including the frozen
file contract's freeze expectation) follow, with the same values.

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

Copy link
Copy Markdown
Contributor Author

Newman API Test Suite: red, and not caused by this PR.

  • The same check is also red on the current development head (Newman API Test Suite and quality / Integration Tests (Newman) both fail there).
  • The 11 errors and 11 failures in this run are all in classes this PR doesn't touch:
    • JobRunMapperNarrowGoldenTest
    • FileVersioningHandlerGoldenTest (PHP fatal: IVersionManager is declared twice from eval()'d code, which depends on test order)
    • TextExtractionJobsGoldenTest
    • EndpointsControllerAnswersGoldenTest
    • SchemaConfigValidatorsGoldenTest
    • ProcessingLogServiceGoldenTest
    • A18InterfaceBindingsTest (the ObjectRetentionHandler data set)
  • None of these build or call ArchiveHandler, FacetHandler, FilePropertyHandler or ObjectStateController.
  • Locally, on this branch merged with origin/development, these all pass: the architecture, contract and kernel guards, tests/Unit/Service/Object and tests/Unit/Controller.

No fix for these failures exists on development yet, so there is nothing to port into this PR. Per the lane brief this PR is finished as opened, so no commits will be added to it.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Frontend Check (test:l10n), (test:l10n:parity) and (format): red, and not caused by this PR.

This PR changes nothing under src/ or l10n/; the diff is PHP and PHPUnit only.

The checks fail on catalogue state that this PR inherits from development:

  • test:l10n: 14 keys are used in src/ but missing from l10n/en.js. The repo's CLAUDE.md already records test:l10n as red at HEAD for this reason, and fixing it is its own §6.15 commit.

  • test:l10n:parity: the key "We could not count the objects. Close this window and try again." is missing from de, fr, es and other locales.

  • format: prettier --check flags many src/ files that are already unformatted on development; this PR changes none of them.

No fix for any of these exists yet, so there is nothing to port into this PR, and adding l10n work would widen it beyond its scope.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Frontend Tests (unit): red, and not caused by this PR.

The only failing suite is src/components/shared/refreshButton.spec.js. All 4,971 tests in the other 239 suites pass. This PR changes no frontend file; its diff is PHP and PHPUnit only, so this jest result is the same as on development.

No fix exists yet, so there is nothing to port into this PR.

(The test:l10n:parity and format failures on this run are covered by my earlier comment.)


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Vue Quality (eslint): red, and not caused by this PR.

eslint flags frontend files only, and this PR changes no .js or .vue file; its diff is PHP and PHPUnit only. The same check is red on #7566, which also touches no frontend, with the same problem count, so the findings come from development.

No fix exists yet, so there is nothing to port into this PR.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

PHP Quality (phpcs) and (psalm): red, and not caused by this PR.

Neither log names a file this PR changes (ArchiveHandler, ArchiveHandlerInterface, ObjectStateRecording, ObjectStateController, FacetHandler, FacetLookups, FilePropertyHandler). The same two checks fail on #7566 because of files neither PR touches, for example lib/Db/ImportPreviewRow.php and lib/Service/ContractBindings.php. Locally, phpcs and phpstan on every touched file report no errors.

No fix exists yet, so there is nothing to port into this PR.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

PHP Quality (phpstan): red, and not caused by this PR.

phpstan reports 24 errors, the same count as on #7566, and none of them is in a file this PR changes. The errors are in classes such as FileTextExtractionJob, EndpointsController, WebhooksController, FlowService and GraphQLService. Locally, phpstan with the repo's phpstan.neon reports no errors on every file this PR touches.

No fix exists yet, so there is nothing to port into this PR.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Hydra Gates: red, and not caused by this PR.

CI runs the gates over the whole tree (--full, the default), and the 7 failing gates (3, 7, 12, 17, 40, 46, 49) report findings from across the repo. For example, gate-7 reports 113 NoAdminRequired methods.

To check what this PR itself adds, I ran run-hydra-gates.sh --scope-to-diff --base origin/development on this branch. None of those 7 gates fails. The only failure in the scoped run is gate-67 (contract parity between lib/Contract/ and the installed gates package), and this PR does not touch lib/Contract/; that gate passed in CI. I also ran check_spec_anchors.py (gate-46) on every lib/ file this PR changes: 0 unresolved targets.

No fix exists for the tree-wide findings yet, and fixing them here would widen this PR well beyond its scope.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

PHP Quality (phpmd): red on development already, but this PR adds one finding.

The phpmd output for this PR has 617 finding lines, against 616 on #7566, which does not touch these handlers. The tree-wide findings were already there. The difference is caused by this PR:

  • lib/Service/Object/FacetHandler.php:68 CouplingBetweenObjects 13. This finding is new: the new FacetLookups type adds one coupling, which pushes the class over the threshold.
  • lib/Service/Object/ArchiveHandler.php:59 CouplingBetweenObjects goes from 14 to 15 because of ObjectStateRecording. That class was already flagged at 14 before this PR.

A fix that adds no @SuppressWarnings: have FacetHandler (and ArchiveHandler) read the mappers through the bundle ($this->lookups->unifiedObjectMapper) instead of re-declaring the typed properties. The class would then no longer name MagicMapperInterface or SchemaMapperInterface directly, and its coupling returns to where it was.

The lane brief says an open PR is finished and must not receive further commits, so I have not pushed that change. A maintainer should decide: accept the one-step coupling increase, or have the fix land in a follow-up PR once this one merges.


Generated by Claude Code

@rubenvdlinde
rubenvdlinde merged commit f4fa253 into main Nov 9, 2026
36 of 49 checks passed
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openregister @ befe33c

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 ❌ 49041/49051 · 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 17:31 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