Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/claude-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
python-version: '3.11'

- name: Setup uv
uses: astral-sh/setup-uv@v8
uses: astral-sh/setup-uv@v8.3.2
with:
version: "latest"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/marimo-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
python-version: "3.11"

- name: Install uv
uses: astral-sh/setup-uv@v8
uses: astral-sh/setup-uv@v8.3.2

- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
python-version: '3.11'

- uses: astral-sh/setup-uv@v8
- uses: astral-sh/setup-uv@v8.3.2
with:
version: "latest"

Expand Down
173 changes: 88 additions & 85 deletions .marimo.toml
Original file line number Diff line number Diff line change
@@ -1,119 +1,122 @@
[experimental]
inline_ai_tooltip = false
rtc_v2 = false
secrets = true
[ai]
enabled = true
inline_tooltip = false
mode = "agent"
rules = "Use altair for interactive visualizations and plotly express for interactive 3d plots\nPrefer polars over pandas for data manipulation due to better performance\nInclude docstrings for all functions using NumPy style\nUse Type hints for all function parameters and return values\nHandle errors with try/except blocks and provide informative error messages\nFollow PEP 8 style guidelines\nWhen working with data:\n- Use altair, plotly for declarative visualizations\n- Prefer polars over pandas\n- Ensure proper error handling for data operations\nFor plotting:\n- Use px.scatter for scatter plots\n- Use px.line for time series\n- Include proper axis labels and titles\n- Set appropriate color schemes\nIntegrate mlflow features and patterns, polars\n\n"

[keymap]
destructive_delete = true
preset = "default"
[ai.anthropic]

[keymap.overrides]
[ai.bedrock]

[diagnostics]
sql_linter = true
[ai.custom_providers]

[runtime]
std_stream_max_bytes = 1000000
default_csv_encoding = "utf-8"
default_sql_output = "native"
default_auto_download = []
on_cell_change = "autorun"
reactive_tests = true
pythonpath = [".", "src"]
dotenv = [".env"]
watcher_on_save = "lazy"
output_max_bytes = 8000000
auto_reload = "autorun"
auto_instantiate = true
[ai.google]

[completion]
signature_hint_on_typing = false
base_url = "http://localhost:11434/v1"
[ai.models]
autocomplete_model = "ollama/devstral-small-2:24b-cloud"
chat_model = "ollama/devstral-2:123b-cloud"
custom_models = []
displayed_models = ["ollama/devstral-2:123b-cloud", "ollama/devstral-small-2:24b-cloud", "ollama/gpt-oss:120b-cloud", "ollama/gpt-oss:20b-cloud"]
edit_model = "ollama/devstral-2:123b-cloud"

[ai.ollama]
api_key = "ollama"
base_url = "http://localhost:11434/v1"
model = "gpt-oss:20b-cloud"
copilot = "custom"
activate_on_typing = true

[language_servers.pylsp]
enable_pyflakes = false
enable_mypy = true
enabled = true
enable_pylint = false
enable_pydocstyle = false
enable_flake8 = false
enable_ruff = true
[ai.open_ai]
api_key = "ollama"
base_url = "http://localhost:11434/v1"
model = "gpt-oss:120b-cloud"

[language_servers.basedpyright]
[ai.open_ai_key]

[language_servers.ty]
[completion]
activate_on_typing = true
api_key = "ollama"
auto_close_pairs = true
base_url = "http://localhost:11434/v1"
copilot = "custom"
model = "gpt-oss:20b-cloud"
signature_hint_on_typing = false

[diagnostics]
sql_linter = true

[display]
cell_output = "above"
code_editor_font_size = 14
dataframes = "rich"
reference_highlighting = false
default_table_max_columns = 50
cell_output = "above"
default_table_page_size = 10
theme = "dark"
default_width = "medium"
code_editor_font_size = 14
reference_highlighting = false
theme = "dark"

[package_management]
manager = "uv"
[experimental]
inline_ai_tooltip = false
rtc_v2 = false
secrets = true

[server]
follow_symlink = false
browser = "default"
[formatting]
line_length = 79

[snippets]
custom_paths = ["snippets"]
include_default_snippets = true
[keymap]
destructive_delete = true
preset = "default"

[ai]
rules = "Use altair for interactive visualizations and plotly express for interactive 3d plots\nPrefer polars over pandas for data manipulation due to better performance\nInclude docstrings for all functions using NumPy style\nUse Type hints for all function parameters and return values\nHandle errors with try/except blocks and provide informative error messages\nFollow PEP 8 style guidelines\nWhen working with data:\n- Use altair, plotly for declarative visualizations\n- Prefer polars over pandas\n- Ensure proper error handling for data operations\nFor plotting:\n- Use px.scatter for scatter plots\n- Use px.line for time series\n- Include proper axis labels and titles\n- Set appropriate color schemes\nIntegrate mlflow features and patterns, polars\n\n"
mode = "manual"
inline_tooltip = false
[keymap.overrides]

[ai.custom_providers]
[language_servers.basedpyright]

[ai.ollama]
api_key = "ollama"
base_url = "http://localhost:11434/v1"
model = "gpt-oss:20b-cloud"
[language_servers.pylsp]
enable_flake8 = false
enable_mypy = true
enable_pydocstyle = false
enable_pyflakes = false
enable_pylint = false
enable_ruff = true
enabled = true

[ai.anthropic]
[language_servers.ty]

[ai.bedrock]
[mcp]
presets = ["marimo", "context7"]

[ai.open_ai]
api_key = "ollama"
base_url = "http://localhost:11434/v1"
model = "gpt-oss:120b-cloud"
[mcp.mcpServers.mlflow]
args = ["mcp", "run"]
command = "mlflow"

[ai.google]
[mcp.mcpServers.mlflow.env]
MLFLOW_TRACKING_URI = "http://localhost:5000"

[ai.models]
custom_models = []
chat_model = "ollama/devstral-2:123b-cloud"
displayed_models = ["ollama/devstral-2:123b-cloud", "ollama/devstral-small-2:24b-cloud", "ollama/gpt-oss:120b-cloud", "ollama/gpt-oss:20b-cloud"]
autocomplete_model = "ollama/devstral-small-2:24b-cloud"
edit_model = "ollama/devstral-2:123b-cloud"
[package_management]
manager = "uv"

[ai.open_ai_key]
[runtime]
auto_instantiate = true
auto_reload = "autorun"
default_auto_download = []
default_csv_encoding = "utf-8"
default_sql_output = "native"
dotenv = [".env"]
on_cell_change = "autorun"
output_max_bytes = 8000000
pythonpath = [".", "src"]
reactive_tests = true
show_tracebacks = false
std_stream_max_bytes = 1000000
watcher_on_save = "lazy"

[save]
autosave = "off"
autosave_delay = 1000
format_on_save = false
autosave = "off"

[formatting]
line_length = 79

[mcp]
presets = ["marimo", "context7"]

[mcp.mcpServers.mlflow]
command = "mlflow"
args = ["mcp", "run"]
[server]
browser = "default"
follow_symlink = false

[mcp.mcpServers.mlflow.env]
MLFLOW_TRACKING_URI = "http://localhost:5000"
[snippets]
custom_paths = ["snippets"]
include_default_snippets = true
26 changes: 25 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.4.0] - 2026-07-15

### Added
- **Parametric heat-rod control feature** (`marimo_flow.control.heat_rod`, `control.pinn_surrogate`): explicit FTCS ground-truth plant (`FiniteDifferenceHeatRod`), a parametric PINN problem builder (`build_heat_rod_problem_spec` — `T(x,t,u)` with the right-boundary temperature `T(1,t,u)=u` as the control input), an MLP reduced-order surrogate (`train_step_surrogate`), and a PINN field-mean → scalar rollout surrogate (`make_pinn_rollout_surrogate` / `register_pinn_surrogate`) for MPC horizon planning.
- **Composition-first control inputs**: `ControlParameterSpec` + `ProblemSpec.control_parameters` (exogenous MPC inputs merged into `domain_bounds` and sampled during PINN training) and a `parametric_dirichlet` `ConditionSpec.kind` that pins an output field to a sampled input axis (`output_field = u`).
- `register_pinn_surrogate_tool` on the control toolset — wraps a trained PINN solver as an MPC surrogate in `deps.registry`.

### Changed
- **Dependencies refreshed** via `uv lock --upgrade`: pydantic-ai-slim 1.84 → 2.10, torch 2.11 → 2.13, mlflow 3.11 → 3.13, transformers 5.5 → 5.13, PINA 0.2.6 → 0.3.1, marimo 0.23.1 → 0.23.9, plus transitive bumps.
- **Migrated to the PINA 0.3 API**: `DomainInterface` moved to `pina.domain`, `FixedValue` to `pina.equation.zoo`, `AbstractProblem` → `BaseProblem`, the PINN-family solvers aliased to their renamed `*SingleModelSolver` forms, and `discretise_domain()` no longer accepts `domains="all"` (the default now samples all domains). `pytest` is warning-free again.
- **pydantic-ai upgraded to 2.x**: the bundled `a2a` extra was dropped, so `fasta2a` is now an explicit direct dependency (the `agent_to_a2a` API is unchanged); the `pydantic-ai-slim` floor is bumped to `>=2.10.0` and the `[ag-ui]` extra retained.
- **Agent graph migrated to the builder-based `pydantic-graph` API**: `build_graph()` now uses `GraphBuilder`, registering the nine v1 `BaseNode` nodes as-is via `g.node(...)`. New `agents.runner.run_graph` drives the run (`graph.run` / `graph.iter`) and logs `FlowState` snapshots to MLflow under `agent_state/`, replacing the deprecated `BaseNode`-`Graph` runner + its persistence machinery.
- MCP builders migrated to `MCPToolset` (from deprecated `MCPServerStreamableHTTP` / `MCPServerStdio`); transport assertions now probe `toolset.client.transport`.
- A2A / AG-UI servers migrated off the deprecated `Agent.to_a2a()` / `Agent.to_ag_ui()`: A2A uses `fasta2a.pydantic_ai.agent_to_a2a`, AG-UI is a bare Starlette app dispatching to `AGUIAdapter.dispatch_request` (the previously-xfailed AG-UI ASGI test now passes).
- `mlflow.pydantic_ai.autolog()` is on by default — mlflow ≥ 3.11.2 fixed the circular-reference crash (mlflow#22693), now falling back to a repr dump. Opt out with `MLFLOW_PYDANTIC_AI_AUTOLOG=0`.
- README reframed as an agentic scientific-computing platform; `pyproject.toml` description + keywords and the GitHub repo About/topics updated to match.
- README gained an architecture diagram (natural language → pydantic-ai → PINA / MLflow / marimo), a consolidated stack table (pydantic-ai, PINA + PyTorch, MLflow, DuckDB, Polars, Plotly, marimo, MCP, Docker CPU/CUDA/XPU), and a **Claude Code integration** section covering the marimo MCP server + the marimo-pair live-kernel workflow.
- Cleared pre-existing ruff findings surfaced by the ruff bump (typer `B008` via `extend-immutable-calls`, `SIM300`, `B017`); `ruff check` is clean again.

### Removed
- `MLflowStatePersistence` (`pydantic-graph` persistence backend) — the builder runner exposes no persistence hook; FlowState snapshotting moved into `agents.runner`.

## [0.3.1] - 2026-04-28

### Added
Expand Down Expand Up @@ -188,6 +210,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Version History Summary

- **0.4.0** (2026-07-15) - Parametric heat-rod control + MPC PINN surrogate, PINA 0.3 / pydantic-ai 2.x migration, README architecture + stack + Claude Code integration
- **0.3.1** (2026-04-28) - Composition-first PDEs, Phases B-F (inverse, mesh, design, stochastic, MPC), Triage/Validation nodes, DuckDB provenance, plotly 3D viz, Windows persistence fix
- **0.3.0** (2026-04-21) - Multi-agent PINA team (`pydantic-graph` + MLflow + Ollama Cloud), CITATION.cff
- **0.2.0** (2026-03-26) - Multi-platform Docker, PINA integration, MCP servers, simplified deps
Expand All @@ -196,7 +219,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **0.1.1** (2025-07-14) - Docker and CI/CD improvements
- **0.1.0** (2025-07-08) - Initial release

[Unreleased]: https://github.com/synapticore-io/marimo-flow/compare/v0.3.1...HEAD
[Unreleased]: https://github.com/synapticore-io/marimo-flow/compare/v0.4.0...HEAD
[0.4.0]: https://github.com/synapticore-io/marimo-flow/compare/v0.3.1...v0.4.0
[0.3.1]: https://github.com/synapticore-io/marimo-flow/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/synapticore-io/marimo-flow/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/synapticore-io/marimo-flow/compare/v0.1.3...v0.2.0
Expand Down
21 changes: 14 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Layout (SPEC-driven):
- `toolsets/` — `problem`, `model`, `solver`, `training`, `validation`,
`data`, `design`, `control`, `curator`, `skills`, `lead`. Each is
a `FunctionToolset[FlowDeps]` singleton.
- `services/` — `ProvenanceStore` (DuckDB, 13 tables), orchestrator
- `services/` — `ProvenanceStore` (DuckDB, 16 tables), orchestrator
policy helpers, experiment lifecycle, `composer`, `mesh_domain`,
`design`, `preset_catalog`.
- `nodes/` — one module per graph node. `triage` builds a `TaskSpec` from
Expand All @@ -86,9 +86,15 @@ Layout (SPEC-driven):
on every dispatch and short-circuits to `End` on escalate/reject verdicts.

Infrastructure:
- Orchestration: `pydantic-graph` (Graph + BaseNode + GraphRunContext)
- Persistence + tracing: MLflow (`mlflow.pytorch.autolog()`; pydantic-ai
autolog is opt-in via `MLFLOW_PYDANTIC_AI_AUTOLOG=1` until mlflow >= 3.11.2)
- Orchestration: `pydantic-graph` builder API — `GraphBuilder` registers the
v1 `BaseNode` subclasses as-is via `g.node(...)` (`BaseNode`/`End`/
`GraphRunContext` survive into pydantic-graph v2; only the legacy `Graph`
runner + its persistence machinery were deprecated). `build_graph()` returns
a builder `Graph`; `agents.runner.run_graph()` drives it (`graph.run` /
`graph.iter`) and logs FlowState snapshots to MLflow under `agent_state/`.
- Persistence + tracing: MLflow (`mlflow.pytorch.autolog()` +
`mlflow.pydantic_ai.autolog()` on by default since mlflow >= 3.11.2 fixed
the circular-ref crash; opt out with `MLFLOW_PYDANTIC_AI_AUTOLOG=0`)
- Provenance: DuckDB at `./provenance.duckdb` (configurable via
`MARIMO_FLOW_PROVENANCE_DB` or `config.yaml`'s `provenance.db_path`).
DuckDB 1.5.2 ships transitively via `marimo[sql]` — no extra project dep.
Expand All @@ -97,16 +103,17 @@ Infrastructure:
model, solver, training, validation, mlflow, lead).
- Each sub-agent loads its skill from `.claude/Skills/<name>/SKILL.md` via
`build_skill_instructions()` — lazy, no message-history bloat.
- Lead agent (`build_lead_agent`) exposed three ways: `mo.ui.chat`,
`agent.to_a2a()`, `agent.to_ag_ui()`. `run_pina_workflow` wraps every
- Lead agent (`build_lead_agent`) exposed three ways: `mo.ui.chat`, an A2A
server (`fasta2a.pydantic_ai.agent_to_a2a`), and an AG-UI server (bare
Starlette + `AGUIAdapter.dispatch_request`). `run_pina_workflow` wraps every
graph run in an `ExperimentRecord` (running → completed / failed).
- `FlowState` holds MLflow URIs **and** the typed specs; live
PINA/torch objects live in `FlowDeps.registry` keyed by URI.
`FlowState.to_jsonable()` renders Pydantic fields via
`model_dump(mode="json")` so snapshots round-trip through JSON.

Testing:
- `tests/agents/test_*.py` — 216 passing, 1 xfailed (baseline 2026-04-25).
- `tests/agents/test_*.py` — 225 passing, 0 xfailed (baseline 2026-06-10).
- `test_demos_compose.py` smoke-tests the notebook spec paths so
schema drift breaks the test suite, not the user-facing demos.
- Nodes that use MCP toolsets (Notebook, MLflow): stub `build_*_mcp` with
Expand Down
Loading
Loading