Skip to content

ADR 0010: build the schema's data object directly (drop the intermediate hierarchy)#8

Merged
IanMayo merged 1 commit into
mainfrom
claude/generate-into-schema-object
Jun 16, 2026
Merged

ADR 0010: build the schema's data object directly (drop the intermediate hierarchy)#8
IanMayo merged 1 commit into
mainfrom
claude/generate-into-schema-object

Conversation

@IanMayo

@IanMayo IanMayo commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

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-generated Platform/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.

  • Deletes: the twin hierarchy that existed only to be converted.
  • Keeps: the pure calculation functions (band_centre_hz, active_max_range_m, …) — they're arithmetic, not a structure, and stay unit-tested.
  • Preserves (non-negotiable): the float → Decimal conversion, 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.
  • Refines ADR 0002 rather than reversing it ("serialise once" stands; "map from a separate hierarchy" becomes "construct directly").

Notes

After you approve the ADR, the refactor will land here: acoustics builds the schema objects directly, mapping.to_model's converter role is folded in, cli.calculate_from_file returns the Platform, 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

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.
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-16 22:03 UTC

Base automatically changed from claude/promote-typed-data-examples-avidnu to main June 16, 2026 21:57
@IanMayo IanMayo merged commit a57b326 into main Jun 16, 2026
3 checks passed
@IanMayo IanMayo deleted the claude/generate-into-schema-object branch June 16, 2026 22:03
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