Refactor ODE analyses through ODESemantics in catlog, catlog-wasm, and frontend - #1364
Open
tim-at-topos wants to merge 83 commits into
Open
tim-at-topos wants to merge 83 commits into
tim-at-topos wants to merge 83 commits into
Conversation
tslil-topos
reviewed
Aug 5, 2026
tim-at-topos
force-pushed
the
tim/refactor-wasm-analyses
branch
from
August 19, 2026 13:43
ce33979 to
7e98d1e
Compare
tim-at-topos
marked this pull request as draft
August 19, 2026 15:33
tim-at-topos
force-pushed
the
tim/refactor-wasm-analyses
branch
18 times, most recently
from
August 25, 2026 18:54
d33d598 to
19c604d
Compare
…ring in all children into scope
…re it has access to the user state Before: BinderContext was provided at the top (in Root), so the store had to fetch the user state itself inside getUserState. After: BinderContext originates inside UserStateProvider, constructed from api and userState. basically ```typescript export function createApiDocumentStore(api: Api, userState: UserState) ... ```
…gnificant cleanup/simplification
* ENH: Add delete button to LLM conversation list * ENH: Tweak hover/active colors in LLM conversation list
* FIX: LLM conversation pane open state on refresh * FIX: Keep LLM conversation pane open when last conversation deleted
When adding """large""" CSV files to an llm conversation automerge exhausts some internal argument stack. No real idea what this is about, but it implies a very leaky abstraction for us. This was fixed upstream, see automerge/automerge#1526 for details. No release has this change yet, so we're forced to add a patch to our collection. This time we have to target cjs files because the npm package doesn't vendor the full source.
we still didn't have enough examples and api coverage for the llm to be competent, and we weren't saying what "kind" of thing was in the scope.
This branch was successfully deployed
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.
For some arcane GitHub reason, #1251 was automatically closed and I cannot reopen it. Then #1363 was a clone with #1319 merged in, but the automatic rebase that GitHub did with its new stacked PR feature messed everything up and broke all the tests. This is a third-time-lucky PR. I'll repeat most of the original PR descriptions below for the sake of the reader.
✨ Brand new features in this mega-merged PR, not previously appearing in any other PR ✨
v1so that everybody's documents don't breakPR 1: ODE semantics via contributions
This PR includes a massive redesign of the way that we handle ODE semantics, which has the bonus of introducing some new capabilities (#1177) as well as (hopefully) making adding new ODE semantics in the future considerably simpler.
p.s. I know this PR adds quite a lot of code for something called a "refactor", but (a) I added a lot of documentation and some new tests, and (b) subsequent PRs focussing on the front-end parts should now be possible, allowing for much more code removal.
PR 2: LaTeX things and front-end refactors
Now that more ODE analyses have LaTeX equations, we should be stricter about the use of
fmt::Displayonly for debugging.This PR introduces some new types and traits (
Latex,ToLatex,ToLatexWithMap) for dealing with LaTeX expressions and rendering object/morphism names nicely in the frontend. It also includes a bunch of tests for ODE semantics in the wasm layer. Finally, as a bonus, it removes a lot of repetitive code fromcatlog-wasm::src::analysesby definingode_semantics_simulationandode_semantics_equations, enabled by #1251, as well as removing some unnecessary types introduced there (such asLotkaVolterraEquationsData, which is justnull).Again, this refactor adds a lot of lines, but that's almost entirely due to how many nice new tests it adds 👼
As a bonus, this PR fixes the following issues:
fmt::Displayfor LaTeX output #1171Although further refactoring is possible (e.g.
lotka_volterra.tsxandlinear_ode.tsxshare a lot of code, and maybe we should do mass-action for stock-flow diagrams by simply migrating them to Petri nets), I think that the "correct" solution to this would be to start looking at generating that code from the definitions of the analyses rather than manually refactoring it. But this is now a much larger, rather separate project, so I think it's a bit out of scope.With that in mind, I would suggest that this PR finally completes the last item in #1177 , and thus closes the RFC-0001 parent issue #1098.