Phase 3 — tests + runtime resolvers: differential parity across the full surface#92
Closed
chrisbc wants to merge 3 commits into
Closed
Phase 3 — tests + runtime resolvers: differential parity across the full surface#92chrisbc wants to merge 3 commits into
chrisbc wants to merge 3 commits into
Conversation
- test_strawberry_parity.py: run each query vs Graphene AND Strawberry, assert identical data (in-process analogue of cli_ab_test) - implement CompositeRuptureDetail computed fields (magnitude/area/length/ rake_mean/rate_*) via rupture_detail; fix get_parent_fault_names shape - harness caught 2 bugs the SDL gate can't: relay global-id encoding (id -> to_global_id, Model C1) and float opacity defaults (1.0 not 1); switch the style-arg default to a mapping (instance default breaks graphql-core coercion) - SDL parity still byte-identical; suite 85 passed; ruff + mypy(new) clean Refs #86
- reuse legacy paginated_filtered_ruptures via a dict adapter (_legacy_filter) that exposes the dict+attr access it expects; convert the graphene connection to the Strawberry RuptureDetailConnection - fix: filter_set_options default must be a plain mapping, not an input instance (an instance default trips strawberry argument coercion) - same class of fix as the style-arg default; SDL parity preserved - test_filter_ruptures_parity: pagination + cursors + node global-id + magnitude all byte-match legacy (note: legacy can't serve pageInfo.hasPreviousPage) Refs #86
- CompositeRuptureSections: delegate every resolver to the legacy graphene static resolvers (aggregates/geojson/MFD/colour reused verbatim) via a graphene root built from the input; colour-scale normalisation converted to string value - node(): legacy has no get_node -> null on both schemas (parity-correct stub) - mypy: None-safe _fso_dict, edges/normalisation narrowing, type:ignore on untyped graphene constructors -> new code clean - 11 differential parity checks (full surface) + suite 88 passed; SDL byte-identical Refs #86
This was referenced Jun 24, 2026
Member
Author
|
Landed via the combined PR #95 (one merge → one test-stage deploy, per runbook G7). Per-phase detail preserved here. |
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.
Stacked migration — PR 5 of N. Base =
migrate/strawberry-p2-schema(Phase 2b, #91).Epic: GNS-Science/nshm-toshi-api#359 · Tracking: #86 · Log:
docs/MIGRATION_LOG.mdImplements every runtime resolver and proves the Strawberry schema is byte-for-byte equivalent to legacy Graphene.
The harness
tests/test_strawberry_parity.pyruns each query through both schemas and asserts identicaldata— the in-process analogue of the Phase 5cli_ab_test. 11 checks spanning about/locations/lists/radii/colour-scale,locations_by_id(Node +radius_geojson),get_parent_fault_names,composite_rupture_detail,filter_ruptures(pagination),filter_rupture_sections(aggregates + MFD + styled geojson), andnode().Resolvers implemented
CompositeRuptureDetailcomputed fields (magnitude/area/length/rake_mean/rate_*) viarupture_detail.filter_rupturespagination — reusepaginated_filtered_rupturesthrough a dict adapter; convert the graphene connection.CompositeRuptureSections— delegate each resolver to the legacy graphene statics (aggregates/geojson/MFD/colour reused verbatim) via a graphene root held asstrawberry.Private.get_parent_fault_names(fixed a real shape bug),node()(null — legacy has noget_node).Bugs the SDL gate can't see — caught by running data through both
idmust beto_global_id(...), not raw.1.0not1) — graphene fillsfill_*from input-field defaults.Verification
strawberry.ext.mypy_plugin)