feat: Phase 4a — Lazy parameter tree & model version endpoints#89
Merged
anth-volk merged 5 commits intoapp-v2-migrationfrom Feb 23, 2026
Merged
Conversation
Allows looking up parameters by their exact names for a given model, returning ParameterRead[] for matches. Enables the app to fetch metadata for specific parameters (e.g. those in a saved policy) without loading the entire parameter catalog. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Accepts country_id and parent_path, returns direct children as nodes (with child_count) or leaf parameters (with full metadata). Adds COUNTRY_MODEL_NAMES mapping to constants for country_id resolution. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Accepts a list of variable names and country_id, returns matching VariableRead objects. Mirrors the parameters/by-name pattern for targeted variable fetching without bulk loading. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Returns the model and its latest version in a single response, keyed by country_id (us/uk). Used on page load for model version checking and cache invalidation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ers/by-name
Aligns the POST /parameters/by-name endpoint with GET /parameters/children
by accepting country_id ("us" or "uk") and resolving the model name
internally via COUNTRY_MODEL_NAMES.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
GET /parameters/children— returns immediate children of a parameter tree node, enabling lazy expansion in the policy parameter selector menuPOST /parameters/by-name— batch-fetches full parameter metadata by dotted names, used by policy pages to resolve only the parameters they needPOST /variables/by-name— batch-fetches variable metadata by name, supporting on-demand variable resolutionGET /tax-benefit-models/by-country/{country_id}— returns the model + latest version for a country, used byuseModelVersionto detect stale cachesGET /analysis/optionsandPOST /analysis/economy-customendpoints with a module registry patternTest plan
test_parameters_children.py(404 lines) — children endpoint: root, nested, leaf, invalid path, empty resultstest_parameters_by_name.py(196 lines) — by-name endpoint: single/multiple params, unknown names, empty inputtest_variables_by_name.py(229 lines) — by-name endpoint: single/multiple vars, unknown names, empty inputtest_models_by_country.py(149 lines) — by-country endpoint: valid/invalid country, response shapetest_module_registry.py(280 lines) — registry pattern: register, lookup, list, duplicate detectiontest_computation_modules.py(282 lines) — extracted computation modulestest_analysis_options.py(129 lines) — options endpointtest_economy_custom.py(317 lines) — economy-custom endpoint🤖 Generated with Claude Code