Skip to content

feat(rate): add canonical regional plan file I/O - #4342

Closed
d-sorgcodexagent[bot] wants to merge 9 commits into
feat/4274-regional-surface-uifrom
feat/4274-regional-plan-io
Closed

feat(rate): add canonical regional plan file I/O#4342
d-sorgcodexagent[bot] wants to merge 9 commits into
feat/4274-regional-surface-uifrom
feat/4274-regional-plan-io

Conversation

@d-sorgcodexagent

Copy link
Copy Markdown
Contributor

Summary

Adds the bounded persistence child for issue #4274 on top of exact draft PR #4339 head cbb9c0a6bdc6a50f59f7a661139b9d53e1892980.

  • imports and exports the canonical ground-regional-material-plan-request/v1 document from both PyQt6 and React
  • preserves exact canonical bytes and editor provenance for unchanged imports, while edited drafts require fresh validation
  • uses native Open/Save As dialogs and a flush/fsync/atomic-replace UTF-8 writer
  • bounds browser and native reads before parsing; native import uses one capped binary-handle read followed by strict UTF-8 decoding
  • preserves exact safe-integer precedence values through 9,007,199,254,740,991 and rejects non-interoperable numeric magnitudes consistently in Python and TypeScript
  • keeps cancellation, failed reads, failed writes, and invalid documents from mutating last-known-good UI or file state

Why

The regional ground editor already had a strict wire contract but no production file boundary. The initial child also exposed two cross-runtime representation gaps during independent review: native precedence values were narrowed by QSpinBox, and Python accepted integer-valued numbers outside JavaScript's exact range. A second review found a time-of-check/time-of-use gap between stat() and an unbounded text read. This stack resolves all three before publication.

User impact

Users can move a validated regional material plan between the standalone PyQt6 and React tools without silently changing identity, precedence, material values, or provenance. Unsupported producer/axis evidence, duplicate keys, oversized content, invalid UTF-8, stale provenance, and unsafe numeric values fail closed with actionable UI status.

This slice does not execute ground physics, persist the plan inside the broader workspace document, claim measured calibration, qualify UpstreamDrift consumers, or close #4274/#4267.

Validation

  • 132 shared ground-contract tests
  • 28 regional and atomic-persistence tests after bounded-read hardening
  • 23 focused React regional-plan tests
  • whole-shell PyQt tooltip coverage
  • 8 campaign-manifest tests
  • Ruff check/format, Black, pinned MyPy 1.13
  • TypeScript, zero-warning ESLint, 199-module Vite production build
  • changed-file and module-size budgets
  • documentation, manifest-layout, changed-test, changed-Python, JSON, and diff governance

Stack and release boundary

  • Base: feat/4274-regional-surface-ui / draft PR feat(rate): add matched regional surface plan editors #4339
  • Reviewed implementation head: d748e7a5ef3da5e6ce7737ff6829e0f14665fe97
  • Publication documentation head: 9ea00edc6db3058fea839a88e11030f4d0afe659
  • Protected CI, review, parent ordering, integration, and release remain required.

@dieterolson

Copy link
Copy Markdown
Collaborator

Consolidated into #4410. Closing to reduce CI/CD runner load.

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.

1 participant