Skip to content

Reject pure stochastic runs with uncovered dynamics - #183

Merged
jc-macdonald merged 3 commits into
mainfrom
feat/182-stochastic-coverage
Oct 2, 2026
Merged

jc-macdonald merged 3 commits into
mainfrom
feat/182-stochastic-coverage

Conversation

@jc-macdonald

@jc-macdonald jc-macdonald commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Pure stochastic mode executes only system.option("reactions"). Transitions without a reaction artifact and typed operators were silently dropped. On current main, a two-age S→I→R model with an unnamed recovery (gamma = 5) runs in direct SSA and nobody recovers.

op_system #249 now publishes reaction_gaps, one record per transition without a reaction. Pure stochastic validation and execution now fail when any are present, listing each one:

Pure stochastic mode executes only reaction artifacts, but 1 transition(s) have none and would never fire: transitions[1] unnamed: I[age] -> R[age] (unnamed). Give each a reaction artifact, or use mode='hybrid' to integrate them deterministically.

Typed operators are rejected in pure stochastic mode for the same reason. Hybrid mode is unchanged, because it already integrates the full RHS minus the jump drift. Producers that predate coverage records are not checked.

Closes #182.

Dependency: the development op_system pins point at the head of op_system #249 (75473e0) while it awaits review, following the existing flepimop2 pin precedent. After #249 merges, the pins should move to its merge commit before this PR merges. I can make that update.

Coverage

  • The unnamed-recovery model fails validate_system and run, with the transition named. With the transition named, the same model validates and recoveries occur.
  • Hybrid mode integrates the uncovered transition.
  • With reaction_gaps removed, which simulates an older producer, the run proceeds as before.
  • chain: stages and routing transitions are reported with their origins and reasons. An axis_kernel operator is rejected.
  • All existing tests pass unchanged, including the renewal and axis-wide aging ensembles, which are fully covered.

Docs

  • Provider README, Stochastic reaction networks: what the guard checks and how to resolve each failure.
  • CHANGELOG entry under Unreleased.

Validation

  • just ci: 592 core tests passed, 2 skipped. 359 provider tests passed (7 new). Ruff and strict mypy passed for both packages.
  • just docs: strict documentation build passed.

Two commits: 270 and 18 changed lines.

🤖 Generated with Claude Code

jc-macdonald and others added 2 commits October 2, 2026 17:27
Pure stochastic mode executes only reaction artifacts, so transitions
without one and typed operators were dropped silently: an unnamed
recovery never fired. Consume op_system's reaction_gaps coverage
records and fail validation and execution with each uncovered
transition named by origin, selectors, and reason, and reject typed
operators. Hybrid mode, which integrates the residual RHS, and producers
without coverage records are unchanged.

Pin the development op_system sources to the head of op_system PR #249,
which adds the records, while it awaits review and merge.

Refs #182

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #182

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
op_system #249 is merged; move the development pins from its branch head
to the merge commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jc-macdonald
jc-macdonald merged commit 56fd16f into main Oct 2, 2026
6 checks passed
@jc-macdonald
jc-macdonald deleted the feat/182-stochastic-coverage branch October 2, 2026 23:15
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.

Reject pure stochastic runs whose reactions do not cover the model

1 participant