OpenPVA news
OpenPVA 2.4.0
- Model authoring from separated inputs:
pva_model()holds a parameter list or parameter-evidence table (extra columns such asunitandsourceare kept), one or more vital-rate tables, the initial population (a cohort-count table, a founder table, a population or a function) and typed defaults for custom individual fields. Fifteen pipeable builders add the ordered lifecycle:step_environment(),step_catastrophe(),step_survival()(ordinary or staged),step_age(),step_pairing(),step_mating(),step_reproduction(),step_dispersal(),step_survey(),step_remove(),step_ceiling(),step_introduce(),step_assign(),step_census()andstep_process(), which inserts any native or custompva_process()(or afunction(params)returning one) at an exact position. Every step takesenabled(a compile-time switch) andwhen(an interval schedule). Declare parameters read indirectly by a callback or factory withuses. Factories run once per enabled step and must be deterministic. Skipped surveys emitsurvey_skip. Skipped catastrophes reset their flag. - One-sided formulas replace routine callbacks:
~ rate("p_surv"),~ age >= maturity,~ if (observed < trigger) release_size else 0.compile_scenario()resolves each formula once against the model’s parameters, population fields, globals,time,dt,n_steps,N,rate("<column>")lookups and a fixed list of pure functions, and rewrites it into an ordinary closure bound to the package namespace, with the process’srequiresderived from what it reads. Nothing is evaluated per interval beyond that closure, and nothing is captured from the workspace. The result is a standardpva_scenario. Compilation always checks the process plan and records the default execution mode ("strict"or"fast").env_ar1(),env_trend(),spatial_correlation(), the litter, offspring-sex and mate helpers andsurvey_quota()accept formulas for their own arguments inside a step. - Fail-fast diagnostics at compile time, before any random number is drawn:
unknown or misspelled symbols (with a suggestion), names shared between
parameters, fields, globals and reserved words, impure code in a formula,
rate tables with overlapping or missing age classes, a missing sex or a
probability outside [0, 1], invalid cohort counts, untyped field defaults,
a step that reads a global written only by a disabled step, a
survey_quota()before its survey, unknown overrides and overrides that cannot affect the scenario. Unused base parameters are reported by the audit, not rejected. run_pva_ensemble()accepts apva_modelasbuild(design columns override parameters by name;NAleaves the base value) or a named list of models selected by amodelcolumn for structural comparisons, validates every design row before drawing a seed, and takesseed_by = TRUEto pair all rows on one seed. A declared parameter can also be a seed-block column,labelorscenario. Each cache entry tracks its own selected model.- Audit:
describe_model()anddescribe_parameters()report cohorts, fields, each step’s formulas with the values bound into them, and for every parameter its base and effective value, consuming steps, status and evidence columns. Base and effective values retain matrix cells and dimnames. The optionallife_table_metrics()check projects the authored rates.describe_lifecycle(),format_lifecycle()andplot()accept apva_model; the text summary lists authored formulas. - Native API additions, all backwards compatible:
pva_process(role = ), with every built-in constructor declaring its role on the process object, sodescribe_lifecycle()reads a stored role instead of re-deriving one. Each constructor declares the role 2.3.0 displayed for that process, so lifecycle tables and diagrams of existing native models are unchanged;age_sex_rate()andvalidate_age_sex_table()accept anagecolumn written as"0","1-2"or"3+",sex = "All"and stratifying columns throughby;introduction_process(fields = )andreproduction_process(newborn_fields = )accept plain named lists;census_process(metrics = )accepts a named list of conditions and values;cohort_population()expands cohort counts into a population. - Documentation: new
vignette("cookbook", package = "OpenPVA"), a model-building guide that uses tables and ordered steps only; README quickstart rewritten aroundpva_model(); the grizzly blurb corrected (mating, harvest and birth share one interval); four missingrequiresdeclarations added to the seasonal-herd example invignette("rosetta"); the workflow vignette runs 20 replicates per scenario instead of 40 to keep the three vignettes inside CRAN’s build time. - Development provenance: this release was implemented and verified by
Anthropic Claude (Claude Fable 5.2, running in Claude Code) working
autonomously to a charter set by Barry W. Brook, on top of the unchanged
2.3.0simulation core.
OpenPVA 2.3.0
- Visual lifecycle translation and inspection:
describe_lifecycle()audits anypva_scenario,pva_run, or process list into an orderedpva_lifecycledata frame classifying ecological roles and inter-process data flows (same_intervalandcarryover).plot()on apva_scenarioorpva_lifecycledraws a pure-base-R node-and-edge lifecycle flow diagram (single row up to 5 steps, two-row clockwise loop for 6+ steps).format_lifecycle()exports plain-text summaries, Mermaid flowcharts, and Graphviz DOT specifications without perturbing the RNG. - Presentation, documentation, and site infrastructure: added the OpenPVA hex
logo (
man/figures/logo.png/scripts/logo.svg), reproducible 3-panel README hero graphic (scripts/make_readme_hero.R), refreshedREADME.md, Zenodo Concept DOI ininst/CITATION, updateddocs/vision_and_scope.md, an agent-first modelling guide (docs/for-agents.md), a new visual workflow vignette (vignette("workflow", package = "OpenPVA")), and a self-containedlitedown::pkg_site()documentation site (site/,scripts/build_site.R, GitHub Pages workflow). - Ergonomic fixes:
shift_logit()now accepts emptylogical(0)fromifelse()when an extinct replicate hitsN == 0while keeping strict validation on non-empty inputs;[.pva_ensemblepreserves provenance attributes across data-frame subsetting; andplot.pva_ensemble()honours scalar or per-membercol. - Development provenance: Developed iteratively in-house by Barry W. Brook
and Google Gemini 4 Neon (presentation, visual inspection, documentation,
and UX polish on top of the frozen
2.2.0simulation core), with an independent read-only cross-lab challenge audit by OpenAI Codex (gpt-6.2-astra).
OpenPVA 2.2.0
- Target removals, ceilings, translocations and individual treatments with
successive weighted draws. Count events report unmet demand.
assign_process()writes a typed treatment, dependency, or group field and accepts a custom event name. mating_process()records seasonal sires with male reproductive skew, capacities and local mating. A state with a declaredmate_fieldretains a departed sire’s attributes, kinship and alleles while a living female references him. Innewborn_fields, the supplied population appends any departed sires needed by the litter with their attributes at exit andalive = FALSE. Staggered mating can preserve other dams’ sire records withclear = FALSE. The grizzly example uses the new mating process.survey_process()records imperfect counts and detected IDs on scheduled visits using replicate substream 5.survey_quota()applies a decision rule to the current observation and handles missed visits explicitly. Seeded runs also preserve a caller’s pending Box–Muller normal.- Litter distributions and offspring sex ratios accept individual rate
callbacks.
qbeta_norm()maps Gaussian environmental variation to beta rates.life_table_metrics()projects either breeding census convention with a finite or repeating terminal age, and reports mean maternal age in the stable population and in a newborn cohort.summarise_pva()reports expected minimum abundance and its Monte Carlo standard error. - Traced pedigrees batch parental kinship queries. The documentation and Rosetta Stone vignette incorporate the recovered spatial GAPPS II 1.3 command and species scripts.
- Development provenance: Developed under Barry W. Brook’s direction using
independent multi-model sessions coordinated through
BWBrook/research-advisor: 2.2.0 backbone implementation, B4 hardening, harvest integration, and R 4.1.0 / R-devel verification by OpenAI Codex (gpt-6.2-astra); B1/B3 cross-critique by Anthropic Claude Opus 5.5, with level-batched traced pedigree propagation, half-year herd vignette, assignment coercion design, and final B5 diff audit by Anthropic Claude Fable 5.2; B1–B3 gap analysis,qbeta_norm()upper-tail guard, and initialmate_fieldfounder checks from Google Gemini 4 Carbon (High); GAPPS II 1.3 archive synthesis, independent verification, and adjudication by Google Gemini 4 Neon.
OpenPVA 2.1.1
- Accept R-devel (
R >= 4.7.0).Random.seedheaders incorporatingbinom.kind(and any future L’Ecuyer-CMRG header extensions satisfyingseed[1L] >= 7L && seed[1L] %% 100L == 7L) in neutral-locus marker-stream validation. - Link
README.mddesign documents via canonical GitHub URLs so CRAN tarball checks encounter no missing relative file URIs.
OpenPVA 2.1.0
- Kinship-aware mating.
mate_min_kinship()gives each female the least related eligible male, up tomax_kinship.pairing_process(priority = "kinship")solves an exact assignment: the largest number of pairs thatcapacityandmax_kinshipallow and, among those, the smallest total kinship. Withpriority = "mean_kinship", scarce territories go first to breeders with low mean kinship to the living population. Pair kinship breaks ties. Both mating rules acceptby = "patch_id"for local mating. The dense and traced stores resolve half-grid ties consistently on the 2^-30 comparison grid. mean_kinship()returns each individual’s mean kinship with the living population.summarise_pedigree()adds founder genome equivalents, computed from the sum of living kinships, andkinship_matrix(against = )returns a rectangular block for two sets of IDs.- Optional neutral-locus gene drop:
pva_state(n_loci = ). The engine owns the genotypes and draws segregation from a stream of its own, so enabling loci changes no demographic outcome of a seeded run.summarise_markers(),marker_founder_shares()andgenetic_metrics()report heterozygosity, allelic richness, retention of the starting alleles and founder shares. Initialization and subsequent segregation have distinct substreams even for a family built inside an ensemble builder. Marker draws preserve the caller’s Box–Muller normal cache. Introductions bring new alleles. summarise_trajectory()accepts metrics that are missing for extinct replicates and reportsn_observed,n_extantand the quartiles. All replicates contribute to cumulative crossing risk and its Wilson limits.summarise_accounting()checks each process receipt and cohort stock.- Correlated environments.
env_ar1()generates anomalies that are autocorrelated in time and correlated among patches or rates, with a stationary start and a pivoted Cholesky factor that accepts perfect synchrony. Named inputs align by component.spatial_correlation()supplies equicorrelation or exponential distance decay.env_trend()accepts time-indexed levels and callbacks.environment_process()passes each variable its name ascontext$variable. - Base-graphics
plot()methods forpva_run(trajectory fan, cumulative risk and accounting views) and for ensembles.run_pva_ensemble()now returns classpva_ensemblewith a print method. Run plots supportadd = TRUE, and annotations use the plotted coordinates. - A vignette, “A GAPPS, Vortex and Leslie-matrix Rosetta Stone for OpenPVA”,
built with
litedown. - Traced kinship blocks use vectorised passes over the ancestor graph.
- Development provenance: Developed under Barry W. Brook’s direction using
independent multi-model sessions coordinated through
BWBrook/research-advisor: 2.1.0 backbone architecture and final B5 diff audit by Anthropic Claude Fable 5.2; B4 hardening, harvest integration, and R 4.1.0/CRAN verification by OpenAI Codex (gpt-6.2-astra); cross-critique and targeted feature design (spatial_correlation(), patch-stratifiedbymating,add = TRUE,print.pva_ensemble()) from Google Gemini 4 Carbon (High); independent verification and adjudication by Google Gemini 4 Neon.
OpenPVA 2.0.1
age_sex_rate()now reports an error when a living individual’s sex is absent from the table. Setmissing_sex = "zero"to assign zero explicitly.mate_from_field(stale = "unpaired")lets a female skip breeding when a previous interval’s mate is absent. Sires lost earlier in the birth interval retain their parentage under both policies.- Dense pedigrees reuse calculations for full siblings and grow the matrix only as needed. A new benchmark checks exact kinship through the switch to ancestor tracing with related and inbred founders.
OpenPVA 2.0.0
- The engine runs a direct ordered list of processes with declared
requires,writesandcreates. Population state is columnar. Dead individuals move to an optional life-history ledger. Callbacks receive the entire living population. Version 2.0.0 uses base and recommended packages on R 4.1.0 or later. - Two-sex breeding requires a mate by default when a mate rule is supplied. Stored sire IDs survive intervening mortality. Bounded litters accept a lower limit and preserve the specified conditional mean.
- Initial parentage sets exact kinships. A value-based dense store and an
ancestor calculation above
max_dense_kinshipsupport related founders and one unknown parent. The scalar drift proxy requires generation time. - Staged survival uses the pre- and post-stage rates and supports entrants between stages without requiring a population field for random draws. Management and environmental processes cover pairing, ceilings, harvest, releases, catastrophes and density feedback.
- Risk summaries check every replicate and interval and share the year-zero rule. Strict validation reconciles entries and losses separately and validates each accounting receipt. Movement records realised patch flows.
- Socket workers inherit library paths and callback dependencies. Unseeded calls advance the caller’s stream once. Ensemble caches track callback revisions, inputs and validation, with deterministic builder and summary RNG.
- Added a standalone grizzly maternal-care and harvest model and updated the woodhen model to use the survival rates of both sexes. Final states and individual ledgers are opt-in outputs.
- Removed
create_individual(),allocate_ids(),initialize_pedigree()and the other record-list helpers. Useadd_individuals()for creation,age_sex_rate()for rate tables and direct population counts for density. - Development provenance: Designed, implemented, cross-audited, and hardened
under Barry W. Brook’s direction using independent multi-model sessions
coordinated through
BWBrook/research-advisor: initial 2.0.0 unified columnar pure-base-R architecture by Anthropic Claude Fable 5.2; release hardening, sparse ancestor pedigree (R/ancestry.R), PSOCK/R 4.1.0 verification, and standalone grizzly example by OpenAI Codex (GPT-6 family); cross-critique and ancestor-compression pedigree design input from Google Gemini 4 Carbon (High); independent verification and adjudication by Google Gemini 4 Neon.
OpenPVA 1.0.1 (development)
- Replaced the fixed biological dispatcher with a validated ordered process engine, explicit state/result/field/event contracts and reproducible replicate streams.
- Added a synthetic source-labelled grizzly benchmark and process-native global density, patch transition/density, generic introduction and optional exact pedigree-ancestry modules.
- Standardised built-in demographic decisions on one pre-process state and made offspring sex an explicit modeller callback.
- Retained strict compilers for modeller-supplied demographic tables while removing packaged biological schedules and silent unmatched-row defaults.
- Removed controller-era lifecycle mutators and the incompatible old-output summary, plotting, management, uncertainty, sensitivity and calibration stack without compatibility adapters.
- Simplified current API, delivery documentation and dependencies around the process-native product. Removed the obsolete Quarto project and dormant YAML/targets/reporting dependencies; Stage 4 will add tools back only with an executable consumer.
- Right-sized repeated test evidence and CI execution while retaining distinct scientific oracles, process-order, accounting, RNG and pedigree contracts.
- Added an installed-package Lord Howe Island woodhen modeller project with explicit sexes, territories and floaters, captive-programme receipts, retained parentage and reloadable replicate evidence.
This development line intentionally contains breaking changes. Historical delivery records and artefacts remain in the repository as provenance.
OpenPVA 1.0.0
- Established the first R package, seeded scenario, YAML, targets, Quarto, spatial/genetic and analysis prototypes.
- Published the R 4.6.1 Mac/CI readiness baseline and release-candidate evidence.
Those prototypes informed the current design but do not override the active North Star or public API.