Skip to content

fix(tests,spec): unstick the two red PHPUnit cells and gate-46 - #2443

Merged
rubenvdlinde merged 1 commit into
developmentfrom
fix/or-red-cells-0812
Aug 12, 2026
Merged

fix(tests,spec): unstick the two red PHPUnit cells and gate-46#2443
rubenvdlinde merged 1 commit into
developmentfrom
fix/or-red-cells-0812

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

What this fixes

Two of the six non-green cells on development at run 31577691221.

PHPUnit (PHP 8.3 / 8.4, NC stable32) — one failing test out of 16306

a5b8dc22b deliberately made MapNode::resolve() ask find() first for a non-numeric reference (it is the only lookup that consults the uuid and slug columns). MapNodeTest::testANonNumericReferenceResolvesByRef still pinned the old order with expects($this->never())->method('find'), so the fix and its own suite disagreed.

The test keeps its intent — a name living in the reference column alone still resolves — but now reaches findByRef() the way production does: through find() missing. A second test pins the new order, which nothing pinned at all.

lib/Service/Flow/Nodes/MapNode.php is not touched.

Hydra Gates — [gate-46] spec-anchor-existence

#2438 tagged three methods @spec openspec/specs/federation/spec.md; that file did not exist. The canonical spec is written (content read off CONFIDENTIALITY_KEYS / PUBLIC_CONFIDENTIALITY / applyShareVisibility(), scenarios matching the existing FederationControllerConfidentialityTest cases), rather than the tags retargeted at a change directory.

Its two requirements carry a reason-bearing @e2e exclude. Without that this PR would trade gate-46 for gate-19: the 7 new scenarios fail gate-19 as missing @e2e and pass with the exclusions.

Positive controls

check without the fix with the fix
MapNodeTest 8 tests, 1 failure (the exact CI message) 9/9 green
revert find()-first in MapNode::resolve() 1 failure + 1 error, exactly the two tests
check_spec_anchors.py (gate-46) 3 findings, 1 target 0
check_e2e_coverage.py (gate-19) FAIL — 7 scenarios PASS
check_spec_coverage.py (gate-16) 0 0

Not fixed here

Two independent reds on `development`, neither of them a defect in shipped
behaviour, both of them a test/spec artefact that CI is right to refuse.

1. PHPUnit (PHP 8.3 and 8.4, NC stable32) — ONE failing test out of 16306.

   a5b8dc2 ("a mapping you just created was invisible to every read")
   deliberately made MapNode::resolve() ask find() FIRST for a non-numeric
   reference, because find() is the only lookup that consults the uuid and
   slug columns. MapNodeTest::testANonNumericReferenceResolvesByRef still
   pinned the OLD order with `expects($this->never())->method('find')`, so
   the fix and its own suite disagreed:

     Expectation failed for method name is "find" when invoked 0 times.
     Method was expected to be called 0 times, actually called 1 time.

   The test's intent — a name living in the `reference` column alone still
   resolves — is unchanged and worth keeping. It now reaches findByRef()
   the way production does: through find() MISSING. That fall-through is
   the part that actually carries an exported flow, so making find() throw
   is a stronger test than making it unreachable.

   testAUuidReferenceResolvesThroughFind is added because nothing pinned
   the new order at all. Its `never()` on findByRef() is the assertion: a
   resolve() that went back to consulting the `reference` column first
   would satisfy every other test in the file.

   POSITIVE CONTROL. At the tree before this commit the suite is 8 tests,
   1 failure — the exact CI message. With this commit, 9/9 green. Deleting
   the find()-first block from MapNode::resolve() again turns it into 1
   failure + 1 error, on exactly these two tests, with the predicted text
   ("expected 1 time, actually 0" and RuntimeException "No mapping matches
   ..."). MapNode.php is restored byte-identical; it is NOT touched here.

2. Hydra Gates — [gate-46] spec-anchor-existence, 3 findings, 1 target.

   #2438 tagged three methods `@spec openspec/specs/federation/spec.md`.
   That file did not exist: federation's only written specs live in
   openspec/changes/federation-scope-enforcement and
   openspec/changes/federated-config-sharing, and a change directory is
   not a canonical target. The gate says "fix the TARGET, not each tag",
   so the canonical spec is written rather than the tags retargeted.

   Its content is read off the code it describes — CONFIDENTIALITY_KEYS,
   PUBLIC_CONFIDENTIALITY and applyShareVisibility() — and its scenarios
   are the seven data-provider cases that already exist in
   FederationControllerConfidentialityTest plus the object-scope bypass.
   Nothing is invented.

   The two requirements carry a reason-bearing `@e2e exclude` naming that
   test file. Without it this commit would have traded gate-46 for
   gate-19: measured, the spec's 7 new scenarios fail gate-19 as
   "missing @e2e" and pass with the excludes.

   POSITIVE CONTROL. check_spec_anchors.py against the two tagged files
   reports exactly the 3 CI findings when the spec is moved aside and 0
   when it is present. check_e2e_coverage.py reports FAIL 7 without the
   exclusions and PASS with them. check_spec_coverage.py (gate-16) is 0
   either way — nothing here is in its scope.

NOT FIXED HERE, and deliberately so: phpmd's 6 findings are all in
lib/Service/Flow (FlowRunAdvancer:83, FlowService:55/78/480,
IterateNode:238, ObjectWriteNode:1445), which is another session's live
work under #2429. phpcs's two errors were fixed by that session in
61c9f38/9c05a3f44 while this was in progress — verified here, full-tree
phpcs is 0 errors on 1428 files at that base. Quality Report is a pure
aggregator and carries no finding of its own.
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openregister @ 9afcd18

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
build
check-specs
test-l10n
composer ✅ 173/173
npm ✅ 546/546
PHPUnit
Newman
Playwright
Hydra gates

Quality workflow — 2026-08-12 09:10 UTC

Download the full PDF report from the workflow artifacts.

@rubenvdlinde
rubenvdlinde merged commit 33e3677 into development Aug 12, 2026
28 of 30 checks passed
@rubenvdlinde
rubenvdlinde deleted the fix/or-red-cells-0812 branch August 12, 2026 09:12
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