Release v0.4.0 - #34
Merged
Merged
Conversation
Add v0.4 mock_spec foundation
Start v0.4 documentation sprint
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add cross-reference comments between .load_metadata_df() and .read_recodeflow_table() to document their intentional differences. Guard .load_metadata_df() against directory path inputs. Pin new tests for verbose messaging and directory-path rejection.
Code-quality fixes: dedupe loaders and dispatch, loud failure modes, runnable examples
There was a problem hiding this comment.
Pull request overview
Merges the v0.4.0 release work into main, introducing the v0.4 mock_spec architecture (adapters, native generation, post-processing diagnostics, optional simstudy backend), updating package metadata (version/NEWS), and adding Divio-style v0.4 documentation and expanded test coverage.
Changes:
- Adds the v0.4
mock_specpipeline: recodeflow adapter, native backend generation, post-processing with diagnostics, and an optional simstudy baseline backend. - Expands/updates test coverage to characterize v0.4 behavior, legacy fallback behavior, and metadata loading from file paths.
- Updates release/docs surface: README, NEWS, pkgdown config, new v0.4 vignettes, and DESCRIPTION/NAMESPACE exports.
Reviewed changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| vignettes/recodeflow-metadata-v04.qmd | New v0.4 how-to for recodeflow metadata → mock_spec → generation + diagnostics. |
| vignettes/migrating-from-v03-v04.qmd | New migration how-to covering routing/fallback and seed/diagnostics differences. |
| vignettes/getting-started-v04.qmd | New v0.4 tutorial for direct mock_spec workflow and wrapper usage. |
| vignettes/diagnostics-and-garbage-v04.qmd | New how-to for reading mockdata_diagnostics and garbage/missing semantics. |
| vignettes/design-philosophy-v04.qmd | New explanation vignette describing v0.4 design goals and scope boundaries. |
| vignettes/choosing-a-backend-v04.qmd | New how-to comparing native vs optional simstudy backend usage. |
| tests/testthat/test-survival-data.R | Adds regression coverage for CSV-path inputs and error propagation in survival wrapper. |
| tests/testthat/test-simstudy-backend.R | Adds simstudy backend tests (unavailable path, contracts, routing, reproducibility). |
| tests/testthat/test-rtype-coercion.R | Adds characterization tests for legacy dispatch rType routing and defaults. |
| tests/testthat/test-recodeflow-mock-spec.R | Adds tests for recodeflow adapter correctness, filtering, and validation behavior. |
| tests/testthat/test-native-backend.R | Adds tests for native backend contracts, reproducibility, and unsupported features. |
| tests/testthat/test-mock-spec.R | Adds tests for spec construction/validation behavior and print method. |
| tests/testthat/test-mock-spec-postprocess.R | Adds tests for post-processing semantics and diagnostics invariants. |
| tests/testthat/test-mock-spec-pipeline.R | Adds end-to-end pipeline tests (baseline + postprocess) including parity checks. |
| tests/testthat/test-load-metadata.R | Adds tests for .load_metadata_df() behavior and error messaging. |
| tests/testthat/test-direct-mock-api.R | Adds tests for direct mock_*() APIs and equivalence with explicit constructors. |
| tests/testthat/test-critical-regressions.R | Adds regression tests for stricter generator errors, duplicate-row warnings, and skip summaries. |
| tests/testthat/test-create-mock-data-v04.R | Adds tests ensuring create_mock_data() routes to v0.4 pipeline and falls back correctly. |
| README.md | Updates version/status and adds a v0.4 direct API example + vignette link. |
| R/mockdata_helpers.R | Removes dplyr dependency from rType defaulting logic. |
| R/mock_spec_simstudy.R | Introduces optional simstudy baseline generation backend for supported spec pieces. |
| R/mock_spec_recodeflow.R | Introduces recodeflow metadata → mock_spec adapter and related helpers. |
| R/mock_spec_postprocess.R | Introduces post-processing layer applying missing/garbage with diagnostics. |
| R/mock_spec_native.R | Introduces native baseline generator with strict scope validation and RNG isolation. |
| R/load_metadata.R | Adds .load_metadata_df() helper to standardize legacy metadata loading and messages. |
| R/create_wide_survival_data.R | Extends survival wrapper to accept CSV paths via .load_metadata_df() and updates docs/errors. |
| R/create_mock_data.R | Adds v0.4 pipeline attempt + legacy fallback logic; refactors legacy dispatch to a generator map; enhances skip summary. |
| R/create_date_var.R | Uses .load_metadata_df(), strengthens missing-variable handling, improves duplicate-row messaging. |
| R/create_con_var.R | Uses .load_metadata_df(), strengthens missing-variable handling, improves duplicate-row messaging. |
| R/create_cat_var.R | Uses .load_metadata_df(), strengthens missing-variable handling, improves duplicate-row messaging. |
| R/add_garbage.R | Updates examples to be runnable/self-contained and avoids \dontrun where feasible. |
| NEWS.md | Adds v0.4.0 release notes (breaking changes + new v0.4 features). |
| NAMESPACE | Exports v0.4 APIs and registers S3 print method for spec validation results. |
| development/v04-simstudy-spike/README.md | Removes spike README (development-only artifact). |
| development/v04-phase-c-comms-note.md | Adds maintainer communication note for Phase C testing. |
| development/v04-documentation-sprint.md | Adds documentation sprint summary/checklist. |
| development/simstudy-v04.md | Adds/retains historical v0.4 production refactor plan context. |
| development/adr/v04-hybrid-backend.md | Adds ADR documenting the hybrid backend decision and constraints. |
| DESCRIPTION | Bumps version to 0.4.0; adjusts dependencies (drops dplyr from Imports; adds simstudy to Suggests). |
| _pkgdown.yml | Adds v0.4 reference sections and includes new v0.4 vignettes in site navigation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+16
to
+28
| if (is.character(x) && length(x) == 1) { | ||
| if (!file.exists(x)) { | ||
| stop(label, " file does not exist: ", x, call. = FALSE) | ||
| } | ||
| # Pin CSV parsing so path inputs behave like data-frame inputs for the | ||
| # recodeflow conventions MockData understands. | ||
| return(read.csv( | ||
| x, | ||
| stringsAsFactors = FALSE, | ||
| check.names = FALSE, | ||
| na.strings = c("", "NA") | ||
| )) | ||
| } |
Comment on lines
+29
to
+33
| if (!is.null(package_root)) { | ||
| devtools::load_all(package_root, quiet = TRUE) | ||
| } else { | ||
| library(MockData) | ||
| } |
Comment on lines
+29
to
+33
| if (!is.null(package_root)) { | ||
| devtools::load_all(package_root, quiet = TRUE) | ||
| } else { | ||
| library(MockData) | ||
| } |
Comment on lines
+29
to
+33
| if (!is.null(package_root)) { | ||
| devtools::load_all(package_root, quiet = TRUE) | ||
| } else { | ||
| library(MockData) | ||
| } |
Comment on lines
+29
to
+33
| if (!is.null(package_root)) { | ||
| devtools::load_all(package_root, quiet = TRUE) | ||
| } else { | ||
| library(MockData) | ||
| } |
Comment on lines
+29
to
+33
| if (!is.null(package_root)) { | ||
| devtools::load_all(package_root, quiet = TRUE) | ||
| } else { | ||
| library(MockData) | ||
| } |
Comment on lines
+29
to
+33
| if (!is.null(package_root)) { | ||
| devtools::load_all(package_root, quiet = TRUE) | ||
| } else { | ||
| library(MockData) | ||
| } |
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.
Summary
Merges the v0.4.0 release from
devtomain. DESCRIPTION already carries Version 0.4.0 ondev; this PR adds the final release prep (README status line updated from "release candidate" to "release", NEWS heading dated, Development section retitled New features).Highlights since v0.3.0 (full details in NEWS.md):
mock_specarchitecture: direct specification helpers, recodeflow metadata adapter, native generation, optional simstudy backend, post-processing diagnosticsState of the branch
[ FAIL 0 | WARN 35 | SKIP 10 | PASS 641 ]R CMD check(no-manual, no-vignettes): 0 errors, 0 warnings, 5 known notesAfter merging
Suggest tagging the merge commit as
v0.4.0.