Skip to content

Architecture Redesign — Master Tracking Issue #9

Description

@EBukin

devPTIpack Architecture Redesign

⚠️ Important caveat: The architecture documents referenced below (in .github/docs/) are proposed designs, not final mandates. They represent one well-researched path forward, but developers implementing these changes should treat them as guidance. Deviations are expected and welcome — discuss in the relevant issue or PR before taking a different direction. The truth is in the code and the tests, not in these documents.

Objective

Revise and refactor devPTIpack from a dual-generation golem package (with ~2000+ lines of dead legacy code, minimal documentation, and ~14% test coverage) into a clean, well-documented, thoroughly tested modern R package with a clear public API and extensible data ingestion.

Architecture Documents

All design documents live in .github/docs/:

Document Content
arch-00-overview.md Package summary, architecture layers, call chains, module generations
arch-01-cleanup.md Function-by-function audit, 6 removal batches, permanent function registry
arch-02-docs.md Documentation standards and implementation order
arch-02.01-testing-calc-pipeline.md Detailed test specs for the calculation pipeline (~71 test cases)
arch-03-testing.md Three-tier testing framework, per-function test map
arch-04-workspace.md Workspace restructuring, vignettes plan, pkgdown structure
arch-05-hex-ingestion.md New hex data ingestion pipeline (5 functions)

Sub-Issues (ordered by dependency)

Relationship to Pre-Existing Issues

Issue Relationship
#2 (debug artifacts) Subsumed by #8 Batch 1
#3 (deprecate v1 modules) Subsumed by #8 Batches 1–5
#4 (remove unused exports) Subsumed by #8 Batch 1
#5 (H3 global database) Upstream design; #13 implements the R package interface
#6 (unit test coverage) Subsumed by #10
#7 (validation refactor) Complementary; can proceed independently
#1 (data interfaces) Long-term vision; #13 addresses the hex ingestion portion

Phasing & Dependencies

#8 Cleanup ──────┐
                 ├──► #11 Documentation ──► #12 Workspace/Vignettes/pkgdown
#10 Testing ─────┘
                        #13 Hex Ingestion (independent, can start anytime)

End-State Goals

After all sub-issues are resolved:

  1. Only modern pipeline remains — entry points: launch_pti(), launch_pti_onepage(), create_new_pti()
  2. All ~95 permanent functions have complete roxygen2 documentation
  3. Test coverage > 80% — Tier 1 (pure functions) + Tier 2 (module servers) automated in CI
  4. Package website deployed on GitHub Pages with grouped vignettes
  5. Hex ingestion pipeline provides developer-facing pre-deployment data prep from custom shapefiles + H3 API
  6. R CMD check passes with 0 warnings, 0 errors, 0 notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureArchitectural design decisions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions