Repository navigation
Conversation
Validate graph model interfaces and correct clearance reference reporting
…#3) * Add conserved mass-action networks and explicit intervention protocols * Record Asma intervention bridge verification and merged baseline * Link review PRs and pin clean Asma bridge source revision --------- Co-authored-by: Raz Arif <a@askaconsult.com>
Graph.subgraph iterated a set of node ids, so the order of nodes in a subgraph, and in its JSON and Mermaid output, changed with PYTHONHASHSEED. Regenerating docs/img/pbpk_elimination_subgraph.mmd reordered its node lines on every run, with no change in content. Subgraphs now keep the parent graph's insertion order and raise KeyError naming any unknown ids. A new test renders the PBPK elimination subgraph under four hash seeds and requires identical output; the test fails on the previous implementation. The regenerated Mermaid source is committed; the graph JSON and validation outputs are unchanged. Claude-Session: https://claude.ai/code/session_01CoFhtFtE7wJgvHKAzNB3xD Co-authored-by: Claude <noreply@anthropic.com>
* Add cited ovarian HGSOC parameter ledger with Crossref checks Introduce a machine-readable treatment-sequence parameter ledger under data/clinical/, extending the project-asma PR #47 registry citation shape with quantitative rows (KNOWN, CONJECTURE, MISSING). Include schema validation, offline pytest coverage, CI hook, and a pinned script with an optional Crossref DOI title/author verification step. Co-authored-by: Orda <orda@askaconsult.com> * Re-verify ledger rows against open full text only Restrict KNOWN to TCGA values read from PMC3163504; downgrade trial and meta-analysis figures to CONJECTURE (abstract only) or MISSING when full text is paywalled or the abstract lacks the quantity. Correct CA-125 and HRD rows and document verification locators. Co-authored-by: Orda <orda@askaconsult.com> * Fix pytest import path and pin TCGA KNOWN ledger values Set pytest pythonpath to the repo root so CI can import scripts without PYTHONPATH. Correct P005 PMC section locators and add regression tests for verified KNOWN numeric values P002–P005. Co-authored-by: Orda <orda@askaconsult.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
* Import SBML reaction networks as verified graphs Add a from-scratch reader for SBML Level 2/3 core (vh/graph/sbml.py): compartments, species, global and local parameters, function definitions, initial assignments, assignment rules and reactions with MathML kinetic laws. Unsupported constructs (events, rate and algebraic rules, delays, fast reactions, stoichiometryMath, conversion factors, variable compartments, required packages) are refused by name. Documents with a DOCTYPE are refused and MathML compiles to closures over a fixed operator table. Models simulate, solve for steady states on the conservation-reduced system and report reduced eigenvalues. vh/graph/stoichiometry.py does exact rational algebra: canonical conservation laws (RREF of the left nullspace) and positive-mass stoichiometric consistency (Gevorgyan et al. 2008) with exactly checked certificates. SBML graphs carry species, reaction, compartment and moiety nodes; the schema recomputes N from edges and checks stoichiometry, location, exact complete conservation and consistency. Validation (scripts/validate_sbml.py, auto-research report): three CC0 BioModels vendored with SHA-256 provenance agree with libRoadRunner, an independent SBML engine used only as a test referee, to <=6.9e-10 on trajectories, <=1.7e-12 on steady states and <=1.3e-9 on reduced eigenvalues; periods match to ~1e-11. Across BIOMD0000000001-060, 49 models are read and 11 refused by name; trajectories of all 49 agree with the referee (median 1.7e-9). The consistency invariant flags 8 models with exact certificates, including a stoichiometry used as a unit conversion in Chassagnole 2002, as its own notes describe. libroadrunner joins the dev extras as a test-only referee. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CoFhtFtE7wJgvHKAzNB3xD * Refuse DTDs in any encoding, not only ASCII-compatible bytes The DOCTYPE/entity refusal scanned raw bytes for "<!doctype" and "<!entity". In UTF-16 those markers are interleaved with NUL bytes, so a UTF-16 document with an internal entity passed the scan and ElementTree expanded it (reported in review on #4). read_sbml now pre-parses with expat, which decodes the declared encoding, and refuses on any DOCTYPE or entity declaration. Input expat cannot decode (for example UTF-32), empty input and truncated XML raise SBMLError instead of passing through. New tests cover UTF-16 with and without a byte-order mark in both byte orders, a UTF-16 document without a DOCTYPE that must still load, and unreadable input; six of the seven fail on the previous code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CoFhtFtE7wJgvHKAzNB3xD --------- Co-authored-by: Claude <noreply@anthropic.com>
…261106 Preserve evidence context and uncertainty at scalar model boundaries
…-graph-stack # Conflicts: # README.md # auto-research/README.md # docs/graph_formalization.md # vh/graph/render.py
…t/foundation-graph-stack # Conflicts: # README.md # auto-research/README.md
This was referenced Nov 9, 2026
rohanarun
reviewed
Nov 10, 2026
|
|
||
| def residual(y): | ||
| x = y * sizes | ||
| f = self.amount_derivative(x) / sizes |
Owner
There was a problem hiding this comment.
A rate that happens to vanish at time zero can produce a false steady state.
amount_derivative(x) defaults to t=0. For a one-species SBML model with initial amount A=10 and the decay law dA/dt = -t*A (using the SBML time symbol), steady_state() returns A=10, success=True, and zero residual. Evaluating that same state at t=1 gives dA/dt=-10.
Please reject steady-state analysis for time-dependent kinetics, including time dependence through assignment rules, or expose this explicitly as a root at a fixed time. The trajectory solver should continue to support time-dependent laws.
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.
What this is
Stack: #5 → #6 → #7 → #8 (this PR is layer 2 of 4). Each branch contains the previous layer, so merging in order with merge commits lands the whole stack in one sweep with no conflicts (verified locally: four sequential merges, final tree identical to the #8 tip, 304 tests passing). GitHub retargets each child to
mainas its parent merges. Please avoid squash- or rebase-merging individual layers, which would strand the child branches' copies of the parent commits.One integration PR moving all merged work from the interim fork Foundation-0/virtual-human (its
mainat6b10b45) onto upstreammain(d6a5963), now that direct contribution here is possible. It is a true merge commit, so fork history and authorship are preserved. Per-feature review already happened on the fork; this PR links that record instead of re-posting it as seven PRs:vh/graph/contracts.py), plasma-referenced clearance reporting (17.104 L/h replaces mixed-basis 28.488 L/h)reactions.py)sbml.py,stoichiometry.py, 3 CC0 BioModels indata/sbml/)data/clinical/, standalone validator)evidence.py)The graph stack is kept in one PR because its parts are interdependent (
evidence→contracts,sbml→stoichiometry, sharedvh/graph/__init__,render.py, README): splitting it would re-conflict on the same files in every piece. If size is a problem, the one clean split is the ledger + Asma docs (novhimports) into a follow-up; happy to do that on request.Merge resolutions (the only 4 conflicted files)
vh/graph/render.py— union of both style/label registries (flowreservoir/junction/conduit+ SBMLspecies/reaction/moiety/reactant/product/modifier/member);clearskeeps the units/reference-basis-aware label.auto-research/README.md— union of index rows (4 fork + vein-flow + evidence-bindings entry).README.md,docs/graph_formalization.md— prose union: upstream flow/Bernoulli sections and fork SBML/clearance sections both kept; the stale 28.488 L/h claim,pbpk_graph.pngembed, and "every edge carries the validated model" wording retired in favour of the corrected plasma-referenced reporting (fork PR Welcome to virtual-human Discussions! #1). The fork banner was dropped for upstream. Docs now reference checked-in Mermaid sources;scripts/validate_graph.pyrender targets updated from the deleted.svgpaths to those.mmdsources (2 lines, folded into the merge commit).pyproject.toml/ CI take the fork versions:libroadrunnerdev dependency (SBML referee, tests only),networkmarker withpytest -q -m "not network"(keeps the live-Crossref DOI test out of default CI), and the offline ledger-validation step. Without these, the merged tree would run a live-network test in CI and silently skip the 9 SBML referee tests.Verification (merged tree, this branch)
pytest -q -m "not network": 251 passed, 6 skipped (py3.12 + libroadrunner; skips are openmm/pyscf gates), 0 failed. Bare numpy/scipy env: 242 passed (= 218 fork + 24 upstream flow, composed cleanly).validate_model_contracts,validate_reaction_experiments,validate_evidence_bindings,validate_ovarian_parameter_ledger,validate_flow(venous headline unchanged: 88.7 mmHg standing),validate_body,validate_sbml(libRoadRunner referee).node web/test_engines.mjs: all JS engine checks pass.6b10b45fork,d6a5963here).Flagged for maintainer call (no action taken)
docs/project-asma-integration.md, parts ofdocs/research-foundation.md, ovarian ledger,scripts/validate_asma_interventions.py): included for provenance; the integration doc itself notes coordination docs need not accompany upstream work. Say the word and I'll strip them in this PR. The Asma validator is opt-in (needs a separate trusted checkout) and is not wired into CI.claude/admiring-cori-0qyybb(kinetic invariants + paraneoplastic exposure, 16 tests passing on its own base) holds unmerged work that predates evidence bindings and overlaps README/ledger semantically. I pushed the branch here unchanged so nothing is lost, and its merge onto this stack is now open as Kinetic invariants and paraneoplastic antigen exposure (final Foundation-0 branch) #8 (292 tests passing there). All other fork branches are content-contained in this merge (verified by blob identity; theircherry +entries are squash-merge artifacts).