refactor(v7): remove 19 duplicate POC endpoints — cascade to v6/v4 twins#2827
Merged
simonredfern merged 3 commits intoJun 2, 2026
Conversation
Http4s700.scala contained 19 endpoints added purely as http4s-migration scaffolding (labelled "// ── POC endpoints — one per EndpointHelper category ──"). Each duplicates an endpoint already defined at a lower version. Per CLAUDE.md, versioning is tech-agnostic: an endpoint belongs at a version only when its signature/behaviour is new there. Removing them lets v700ToV600Bridge cascade each request to wherever the endpoint is genuinely defined (v6 for 18 of 19, v4 for getExplicitCounterpartyById which has no v5/v6 twin). getBanks was already removed in bd9f8ca. This commit handles the other 19. Deep static audit (roles / error-lists / auth-helper / query-param parsing / data-flow — axes the original handoff doc admitted it skipped) found 3 of the 19 are not identical to their twins but are *incomplete* POC versions. Deleting them improves behaviour by cascading to the fuller implementation: - getCurrentUser: v7 silently dropped onBehalfOfUser delegation; v6 computes and passes it (Http4s600.scala:205-213). - getUsers: v7 lacked sort_by validation (FilterSortByNotAllowedForEndpoint, FilterSortByError, FilterSortDirectionError); v6 enforces it. - getExplicitCounterpartyById: v7 used withCounterparty (middleware 404 on missing counterparty); v4 twin uses withView + inline resolution (400). Cascades two hops to Http4s400 (newest shape, no v5/v6 twin). The 3 kept endpoints (deleteEntitlement / addEntitlement / getUserByUserId) have intentional v7 improvements (204, 409, 404 vs older 200/400) and stay. Http4s700.scala: 4060 → 3369 lines; resourceDoc count 64 → 45. Test cleanup (Appendix C): - Http4s700RoutesTest: 141 → 86 scenarios. Deleted the 20 behavioural feature blocks that tested removed endpoints at their v7 URLs (anti-pattern). Kept all infrastructure scenarios; repointed 3 fixtures from removed-endpoint URLs to native v7 URLs (/root, deleteEntitlement). - ResourceDocMiddlewareEnableDisablePropsTest: repointed versionsOpId from getScannedApiVersions (now removed) to getErrorMessages (public, native v7). Verified: 258 tests across 8 suites pass (Http4s700RoutesTest 86, ResourceDocsTest 63, Http4sLiftBridgePropertyTest 51, V7ResourceDocsAggregationTest 14, SwaggerDocsTest 12, Http4sServerIntegrationTest 16, ResourceDocMiddlewareEnableDisablePropsTest 10, Http4s700TransactionTest 6). Cascade confirmed: removed-endpoint URLs return correct data with X-OBP-Version-Served: v6.0.0.
af4e5e8 to
7c8d44b
Compare
…cate-v7-endpoints # Conflicts: # CLAUDE.md
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Http4s700.scala contained 19 endpoints added purely as http4s-migration scaffolding (labelled "// ── POC endpoints — one per EndpointHelper category ──"). Each duplicates an endpoint already defined at a lower version. Per CLAUDE.md, versioning is tech-agnostic: an endpoint belongs at a version only when its signature/behaviour is new there. Removing them lets v700ToV600Bridge cascade each request to wherever the endpoint is genuinely defined (v6 for 18 of 19, v4 for getExplicitCounterpartyById which has no v5/v6 twin).
getBanks was already removed in bd9f8ca. This commit handles the other 19.
Deep static audit (roles / error-lists / auth-helper / query-param parsing / data-flow — axes the original handoff doc admitted it skipped) found 3 of the 19 are not identical to their twins but are incomplete POC versions. Deleting them improves behaviour by cascading to the fuller implementation:
The 3 kept endpoints (deleteEntitlement / addEntitlement / getUserByUserId) have intentional v7 improvements (204, 409, 404 vs older 200/400) and stay.
Http4s700.scala: 4060 → 3369 lines; resourceDoc count 64 → 45.
Test cleanup (Appendix C):
Verified: 258 tests across 8 suites pass (Http4s700RoutesTest 86, ResourceDocsTest 63, Http4sLiftBridgePropertyTest 51, V7ResourceDocsAggregationTest 14, SwaggerDocsTest 12, Http4sServerIntegrationTest 16, ResourceDocMiddlewareEnableDisablePropsTest 10, Http4s700TransactionTest 6). Cascade confirmed: removed-endpoint URLs return correct data with X-OBP-Version-Served: v6.0.0.