ADR 0010: build the schema's data object directly (drop the intermediate hierarchy)#8
Merged
Merged
Conversation
Records the decision to drop the intermediate CalculationResult hierarchy and
populate the schema-generated objects directly, with the stakeholder
defensibility rationale ("one data object that meets the schema, proven to").
Status: Proposed — for review before any code change. Refines ADR 0002;
preserves the range-checks, quantisation, and both verification gates.
|
Base automatically changed from
claude/promote-typed-data-examples-avidnu
to
main
June 16, 2026 21:57
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.
ADR for review — code follows after approval
This PR contains one file: a new ADR (
docs/decisions/0010-build-schema-object-directly.md), proposed for your review before any pipeline code changes. Once you're happy with it, I'll push the refactor (code + tests + doc updates) onto this same branch.The decision it records
Drop the intermediate domain hierarchy (
CalculationResult,SectorResult,BandResult, …) and have the acoustic calculation populate the schema-generatedPlatform/Sector/… objects directly — so the process is the one you can defend to stakeholders: we build one data object that meets the schema, and prove it does.band_centre_hz,active_max_range_m, …) — they're arithmetic, not a structure, and stay unit-tested.float → Decimalconversion, fixed quantisation, range-checks (MappingError), and both verification gates — these are what prove the object meets the schema, so they move to construction rather than disappearing.Notes
mkdocs build --strictis clean.claude/promote-typed-data-examples-avidnuso this diff shows only the ADR. When docs: promote the typed-data flow and reframe it end-to-end #7 merges tomain, GitHub will retarget this PR's base; I'll rebase as needed.After you approve the ADR, the refactor will land here:
acousticsbuilds the schema objects directly,mapping.to_model's converter role is folded in,cli.calculate_from_filereturns thePlatform, tests assert on the built object, and the typed-data / pipeline-data-flow pages are updated to match.🤖 Generated with Claude Code
Generated by Claude Code