Skip to content

feat!: update models to va-spec 1.1.0-ballot.2026-09.1 - #78

Merged
korikuzma merged 16 commits into
va-spec/1.1.0from
ballot-updates
Oct 1, 2026
Merged

korikuzma merged 16 commits into
va-spec/1.1.0from
ballot-updates

Conversation

@korikuzma

@korikuzma korikuzma commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

@korikuzma
korikuzma requested a review from larrybabb September 30, 2026 08:32
@korikuzma korikuzma self-assigned this Sep 30, 2026
larrybabb and others added 2 commits September 30, 2026 05:51
Addresses two review findings from #78. Targets the `ballot-updates`
branch so the fixes land in that PR.

## 1. Base-namespace fixtures were silently unvalidated

The va-spec `1.1.0-ballot.2026-09` submodule labels core/base test
fixtures with the namespace `va-spec` (no dot); profile fixtures use
`va-spec.<profile>`. The fixture-discovery loop in
`test_va_spec_fixtures_validation.py` only kept namespaces matching
`startswith("va-spec.")`, so **all 39 base fixtures were dropped** and
`test_va_spec_fixtures` validated only the 20 profile fixtures — while
still passing green, hiding the loss of coverage.

Fix: accept the bare `va-spec` namespace (routed to `VaSpecSchema.BASE`)
and `continue` past any namespace `get_va_spec_schema` doesn't recognize
(also removes a latent `KeyError` on `VA_SPEC_TEST_DEFINITIONS[None]`).

Routing after the fix (verified against the pinned submodule's
`test_definitions.yaml`):

| schema | fixtures |
|--------|----------|
| BASE   | 39 (was **0**) |
| AAC_2017 | 11 |
| ACMG_2015 | 5 |
| CCV_2022 | 4 |
| skipped (`vrs`) | 2 |

## 2. AAC `validate_tier_evidence_lines` crashed on non-dict input

`VariantClinicalSignificanceStatement.validate_tier_evidence_lines` runs
in pydantic `mode="before"` and called `values.get(...)`
unconditionally, so validating from a non-dict input (e.g.
`model_validate("propositions.json#/1")`) raised `AttributeError`
instead of a normal validation error. Added an `isinstance(values,
dict)` passthrough guard, matching the existing nested type guards in
the same validator.

## Verification
- `ruff` / `ruff-format` pre-commit hooks pass on both files.
- Fixture routing table above reproduced with the real submodule
namespaces.
- Non-dict guard exercised (str / list / `None` pass through; dict still
processed).

Note: the local environment has stale dependency versions (vrs 2.0.0 /
cat_vrs 0.5.0, no `ga4gh.core.metadata`), so the re-enabled base
fixtures could not be executed here — CI on the updated deps should
confirm they validate.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
korikuzma and others added 5 commits September 30, 2026 06:04
)

Two remaining cleanups from the review of #78. (The third — the
duplicated `iriReference` member in
`ExperimentalVariantFunctionalImpactProposition.object` — was already
fixed on `ballot-updates` in "fix dup", so it's not included here.)

## 1. `VariantOncogenicityStatement.classification` was undocumented
The field used `Field(...,)` with no `description`, so the `Field()`
wrapper added nothing over a bare annotation and the field shipped
undocumented (unlike its ACMG/AAC siblings and the base
`Statement.classification`). Added a CCV-appropriate description
mirroring the sibling profiles.

## 2. Method type resolved by mangled member NAME instead of value
`_validate_method_type_evidence_outcome` did
`cls.MethodType[method_type.upper()]`, looking the enum up by **member
name**. That only works because every `MethodType` value happens to
equal its lowercased member name — a coupling that silently breaks the
day a value diverges from its identifier. `specifiedBy.methodType` holds
the enum **value**, so it's now resolved with
`cls.MethodType(method_type)` (value lookup), keeping the same friendly
error message.

## Verification
- `ruff` / `ruff-format` pre-commit hooks pass.
- Value lookup resolves all 17 ACMG + 8 CCV method-type values (verified
against the enum source); unknown strings raise `ValueError`, which the
surrounding `except` still converts to the friendly message.

Note: local dependency versions are stale (vrs 2.0.0 / cat_vrs 0.5.0, no
`ga4gh.core.metadata`), so the full model suite could not be executed
here — CI on the updated deps should confirm.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@larrybabb larrybabb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@korikuzma
korikuzma merged commit 8c89a96 into va-spec/1.1.0 Oct 1, 2026
8 checks passed
@korikuzma
korikuzma deleted the ballot-updates branch October 1, 2026 04:23
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.

2 participants