Skip to content

[access] refactor(service): RetentionPass for processActivity, generateJWT from the configuration - #8428

Merged
rubenvdlinde merged 8 commits into
mainfrom
cloud/s15-service-interfacing
Nov 12, 2026
Merged

rubenvdlinde merged 8 commits into
mainfrom
cloud/s15-service-interfacing

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Lane S15, round 12 wave S: unit interfacing in lib/Service (ADR-011). Touches the retention path, hence [access].

What changed

  • Rule 2, AvgRetentionService::processActivity() (3 → 2): the reference time and the dry-run flag of one pass travel as RetentionPass (new final value object beside the service, 2 public readonly fields, named after the operation). runRetentionPass(bool $dryRun = false) keeps its signature (it is the AvgRetentionPassInterface contract) and builds the object on its first line. Erase / withhold outcomes are unchanged: the legal-hold and clock checks still run before any soft delete, in the same order.
  • Rule 2, AuthenticationService::generateJWT() (4 → 2): takes the payload and the auth configuration and derives the signing key and the protected header from it, the way fetchJWTToken() did before calling it. Same header (alg, typ, optional x5t), same key, same exceptions.
  • Tests first: AvgRetentionPassGoldenTest (new, committed before the change, green on the old code) pins a dry run (matched, nothing erased, nothing withheld), a real run's per-activity report, and the skip of an activity without a usable bewaartermijn. Mutation check: flipping the dry-run condition fails 3 of its 4 tests. The existing legal-hold tests (allowed and refused outcomes) stay green unchanged. The three reflection tests of generateJWT pass the configuration instead of a prebuilt key.

What ran

  • AvgRetentionServiceLegalHoldTest + AvgRetentionPassGoldenTest (8), AuthenticationServiceTest (53): OK.
  • Not run here: full guard suites and the Unit suite run in the reviewer and integrator lanes (local machine overloaded). Ran locally: Adr011ValueObjectRulesTest and A03InterfaceBindingsTest (OK, 72 tests), ControllerServicesWiringTest (OK, 141), and 70% of the guard directories before the run was stopped for load, with no failure.
  • php -l, phpcs (0 errors; inherited class @spec warnings), phpstan (no errors) on touched files.

Left (S15, lib/Service)

  • AvgRetentionService::__construct (6p), reason (e): it holds two refusal guards that stay direct parameters (ArchivalRetentionGuard, RetentionClockService), and its other collaborators (db, processing-activity mapper, object mapper, logger) form no capability aggregate with three consumers in this lane's files.
  • AuditHashService, AppRegisterImportRunner, CospendLinkService constructors (4p), reason (e): no three-consumer aggregate over their collaborators in this lane's files.
  • CospendLinkService::linkBill() / createAndLinkProject(), reason (a): ADR-019 link-service facade called from CospendLinksController; both are already delegates of one or two lines to value-object methods.

AI disclosure: prepared by Claude Code (claude-opus-5-5) for lane S15; reviewed by the human who merges it.

…tion pass

Assisted-by: ClaudeCode:claude-opus-5-5
…m the configuration

ADR-011 Rule 2: processActivity() takes the activity and a RetentionPass
(reference time and dry-run flag); generateJWT() takes the payload and the
auth configuration and derives the key and header from it.

Assisted-by: ClaudeCode:claude-opus-5-5
generateJWT resolves the key first again, so an unsupported or non-string algorithm is refused with BadRequestException rather than a TypeError from the header. A test pins that.

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

RetentionPass is reapplied on main's split processActivity helpers; the retention pass test builds the guard through ArchivalSchemaLookup as main now requires.

Assisted-by: ClaudeCode:claude-opus-5-5
Assisted-by: ClaudeCode:claude-opus-5-5
@rubenvdlinde
rubenvdlinde merged commit e29e5e1 into main Nov 12, 2026
14 of 20 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openregister @ bbbd54f

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-newman-route-ratchet ✅
composer ✅ ✅ 169/169
npm ✅ ✅ 639/639
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ❌ 56758/56774 · 27 skipped (worst of 3 legs: PHP 8.3, NC stable33, pgsql; counts from 3 of 8 legs)
Newman ❌
Playwright ❌ 237/324 · 5 skipped · 164 did not run
Hydra gates ❌

Quality workflow — 2026-11-13 23:22 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.

1 participant