From fd30b61c389b616647cadcb9883aa41be7a01dd5 Mon Sep 17 00:00:00 2001 From: Gergo Magyar Date: Mon, 11 May 2026 14:54:34 +0100 Subject: [PATCH] test(php): gate legacy-DAG-divergent assertions via parity helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI scope-parity / php parity was failing under REGISTRY_PRIMARY_PHP=0 on three assertions added by commit af9af4a9 (U1 arity-narrowing, U3 trait shadows parent). Per that commit's stance — "parity with the legacy DAG is not a correctness criterion when the legacy DAG itself has the same defect" — backporting these fixes to the legacy resolver is out of scope. Adopt the existing sibling pattern (csharp/typescript/python use the same helper): - php.test.ts: switch to `const it = createResolverParityIt('php')` so expected-failure assertions skip under legacy mode. - helpers.ts: register three test names in LEGACY_RESOLVER_PARITY_EXPECTED_FAILURES.php with the rationale. Verified locally: 172 passed + 3 skipped under REGISTRY_PRIMARY_PHP=0, 175 passed under REGISTRY_PRIMARY_PHP=1, tsc clean. --- gitnexus/test/integration/resolvers/helpers.ts | 17 +++++++++++++++++ gitnexus/test/integration/resolvers/php.test.ts | 9 ++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/gitnexus/test/integration/resolvers/helpers.ts b/gitnexus/test/integration/resolvers/helpers.ts index b8e2676c6..430c6d6f1 100644 --- a/gitnexus/test/integration/resolvers/helpers.ts +++ b/gitnexus/test/integration/resolvers/helpers.ts @@ -34,6 +34,23 @@ const LEGACY_RESOLVER_PARITY_EXPECTED_FAILURES: Readonlymethod()` precedence inside a class that composes a trait AND + // extends a parent both defining the same method requires the augmented + // trait-aware MRO (trait shadows parent). The legacy DAG has no + // trait-aware MRO, so it fails to bind the call to the trait. Scope- + // resolver-only correctness win (commit af9af4a9 U3). + '$this->record() still resolves to Auditable::record (trait shadows parent)', + ]), python: new Set([ // Suffix-fallback lex tiebreak depends on the registry-primary // resolver's deterministic sort. The legacy resolver returns the diff --git a/gitnexus/test/integration/resolvers/php.test.ts b/gitnexus/test/integration/resolvers/php.test.ts index 09fdac660..59f906490 100644 --- a/gitnexus/test/integration/resolvers/php.test.ts +++ b/gitnexus/test/integration/resolvers/php.test.ts @@ -1,11 +1,12 @@ /** * PHP: PSR-4 imports, extends, implements, trait use, enums, calls + ambiguous disambiguation */ -import { describe, it, expect, beforeAll } from 'vitest'; +import { describe, expect, beforeAll } from 'vitest'; import path from 'path'; import { FIXTURES, CROSS_FILE_FIXTURES, + createResolverParityIt, getRelationships, getNodesByLabel, getNodesByLabelFull, @@ -14,6 +15,12 @@ import { type PipelineResult, } from './helpers.js'; +// Wrap vitest's `it` so legacy-DAG-only divergences (commit af9af4a9 U1/U3) +// are skipped under REGISTRY_PRIMARY_PHP=0. The skip list lives in +// helpers.ts:LEGACY_RESOLVER_PARITY_EXPECTED_FAILURES.php — sibling pattern +// to csharp/typescript/python. +const it = createResolverParityIt('php'); + // --------------------------------------------------------------------------- // Heritage: PSR-4 imports, extends, implements, trait use, enums, calls // ---------------------------------------------------------------------------