Skip to content

Name incomplete reactions and their remedy for adaptive tau - #189

Merged
jc-macdonald merged 2 commits into
mainfrom
feat/188-adaptive-tau-guidance
Oct 3, 2026
Merged

jc-macdonald merged 2 commits into
mainfrom
feat/188-adaptive-tau-guidance

Conversation

@jc-macdonald

Copy link
Copy Markdown
Member

Adaptive tau-leaping requires complete molecular reactant metadata. Two problems with how it reported missing metadata:

  • It failed only at run time, without saying which reactions were incomplete.
  • It advised adding an explicit reactants list to every op_system transition. Since op_system #251, transitions generated by chain: and coord_shift declare catalysts instead, and coord_shift rejects reactants. So the advice could not be followed for exactly the models #251 targets.

No op_engine test covered adaptive tau-leaping on generated reactions.

Closes #188.

Behavior

  • Compiled network: CompiledReactionNetwork.incomplete_reactions names the selected reactions without complete metadata.
  • Error message: both the run-time error and a new validate_system issue (incomplete_reactants) list those reactions, in declaration order. They give both remedies: reactants on ordinary transitions, or catalysts on chain: and coord_shift entries. The message keeps the phrase "complete molecular reactant metadata" that existing callers match.
  • Hybrid mode: validation checks only the selected stochastic_reactions, matching what the network compiles.
  • No dependency change: the development pins are already on op_system main (#252 merge).

Coverage

  • Declared catalysts: an age-structured SIR with a two-stage chain: infectious period (entry.catalysts lists both stages, and the chain's catalysts: []) and axis-wide aging over all four compartments (catalysts: []). It publishes seven complete reactions and validates cleanly. Under adaptive tau-leaping it keeps integer, non-negative states, a non-increasing total (aging out of the last bin is absorbing), and produces recoveries.
  • Without declarations: validation reports one incomplete_reactants issue naming every generated reaction and both remedies, and run raises with the same list.
  • Hybrid selection: reports only the selected reaction.

Docs

  • Provider README, adaptive tau-leaping paragraph: catalysts for generated transitions.
  • CHANGELOG entry under Unreleased.

Validation

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

Two commits: 222 and 10 changed lines.

🤖 Generated with Claude Code

jc-macdonald and others added 2 commits October 2, 2026 19:19
Adaptive tau-leaping rejected incomplete reactant metadata only at run
time, without naming the reactions, and advised an explicit reactants
list, which chain: and coord_shift entries cannot declare: since op_system
#251 they declare catalysts instead.

Record the incomplete reactions in the compiled network, name them in the
run-time error with both remedies, and report the same issue from
validate_system for the selected jump reactions. Cover an age-structured
SIR with a staged chain and axis-wide aging that runs once catalysts are
declared.

Refs #188

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jc-macdonald
jc-macdonald merged commit c16ee22 into main Oct 3, 2026
6 checks passed
@jc-macdonald
jc-macdonald deleted the feat/188-adaptive-tau-guidance branch October 3, 2026 00:36
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.

Adaptive tau-leaping guidance and coverage for generated reactions

1 participant