Skip to content

Release v0.4.0 — heat-rod MPC control + PINA 0.3 / pydantic-ai 2.x#35

Merged
bjoernbethge merged 10 commits into
mainfrom
release/0.4.0
Jul 15, 2026
Merged

Release v0.4.0 — heat-rod MPC control + PINA 0.3 / pydantic-ai 2.x#35
bjoernbethge merged 10 commits into
mainfrom
release/0.4.0

Conversation

@bjoernbethge

Copy link
Copy Markdown
Collaborator

Prepares the 0.4.0 release.

Highlights

  • feat(control): parametric heat-rod PINN surrogate for MPC — controllable 1D heat-rod plant (FiniteDifferenceHeatRod, FTCS + stability guard), parametric PINN problem T(x,t,u) with T(1,t,u)=u as the control input, MLP ROM + PINN field-mean rollout surrogate for horizon planning. New composition-first primitives: ControlParameterSpec / ProblemSpec.control_parameters and a parametric_dirichlet condition kind.
  • fix: migrate to the PINA 0.3 APIDomainInterfacepina.domain, FixedValuepina.equation.zoo, AbstractProblemBaseProblem, PINN-family solver renames aliased back to short names, and discretise_domain(domains="all") dropped (default samples all). pytest warning-free again.
  • depsuv lock --upgrade: pydantic-ai 1.84→2.10 (a2a extra dropped → fasta2a now an explicit dep), torch 2.11→2.13, transformers 5.5→5.13, PINA 0.2.6→0.3.1, mlflow 3.11→3.13, plus transitive bumps.
  • docs — README architecture diagram (natural language → pydantic-ai → PINA/MLflow/marimo), consolidated stack table, and a Claude Code integration section (marimo MCP + marimo-pair).

Breaking (dependency majors)

  • PINA 0.2→0.3 and pydantic-ai 1.x→2.x. The agent graph/nodes/toolsets are unaffected; only the A2A transport needed the fasta2a re-add.

Verification

  • ruff check — clean
  • pytest232 passed, 0 warnings
  • uv build — sdist + wheel built as 0.4.0

After merge

Tag v0.4.0 on main and cut the GitHub Release (triggers python-publish.yml → PyPI + Docker).

🤖 Generated with Claude Code

claude and others added 10 commits June 10, 2026 10:33
…deps): upgrade lockfile

README now leads with the multi-agent PINA team (pydantic-graph + MLflow
+ marimo chat / A2A / AG-UI) instead of selling 'reactive notebooks'.
New hero, features, and a verified agentic quickstart (lead_chat /
FlowDeps / mo.ui.chat, the marimo-flow CLI, and the A2A/AG-UI servers).
Corrects provenance table count 13 -> 16 and drops the stray 'serena'
from the core MCP server list (it's only an extra .vscode/mcp.json entry).

Deps: uv lock --upgrade pulls latest within existing >= floors
(pydantic-ai/-graph 1.84 -> 1.106, torch 2.11 -> 2.12, mlflow 3.11 ->
3.13, transformers 5.5 -> 5.10, marimo 0.23.1 -> 0.23.9). Full suite
green: 226 passed, 1 xfailed.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…e: clean up docs + metadata

Resolves every deprecation warning surfaced by the 1.84->1.106 pydantic-ai
/ pydantic-graph bump — full suite stays green (225 passed, 0 xfailed, 0
warnings) and `ruff check` is clean.

Graph runner:
- build_graph() now uses the builder-based GraphBuilder API; the nine v1
  BaseNode nodes are registered as-is via g.node(...) (BaseNode/End/
  GraphRunContext survive into pydantic-graph v2).
- New agents.runner.run_graph drives the run (graph.run / graph.iter) and
  logs FlowState snapshots to MLflow under agent_state/. Drops
  MLflowStatePersistence — the builder runner has no persistence hook.

Toolsets / servers:
- MCP builders -> MCPToolset (from MCPServerStreamableHTTP/MCPServerStdio).
- A2A -> fasta2a.pydantic_ai.agent_to_a2a; AG-UI -> bare Starlette +
  AGUIAdapter.dispatch_request (the AG-UI ASGI test un-xfails).
- mlflow.pydantic_ai.autolog() on by default (mlflow >= 3.11.2 fixed the
  circular-ref crash); opt out via MLFLOW_PYDANTIC_AI_AUTOLOG=0.

Docs / metadata:
- Fixed stale counts (provenance 13 -> 16 tables; tests -> 225/0 xfailed).
- pyproject description + keywords reframed agentic-first; GitHub About
  updated to match. CHANGELOG [Unreleased] documents the migration.
- Cleared pre-existing ruff findings (typer B008 via extend-immutable-calls,
  SIM300, B017) exposed by the ruff bump.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
mlflow.pytorch autolog reloads the trained checkpoint with
torch.load(weights_only=True) (the torch>=2.6 default). PINA checkpoints
embed LabelTensor instances, so the reload raised 'Weights only load
failed: Unsupported global pina.label_tensor.LabelTensor' and the model
artifact was never captured. Register LabelTensor via
torch.serialization.add_safe_globals at training-module import (idempotent).

Verified: torch.load(weights_only=True) of a real run checkpoint now
succeeds; full suite stays green (225 passed).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…shboard

The provenance preset_problems table has no 'payload' column (it stores
the composition under 'spec_json'). The 3D-preset-preview cell only runs
once a real preset exists, so the wrong column name stayed latent until
an actual agent run populated the catalog — then it raised 'Binder Error:
Referenced column "payload" not found'. All five example notebooks now
build via 'marimo export html' (01 needs --no-sandbox / the project env
due to its PEP723 header).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
mlflow 3.13's pydantic-ai integration lags pydantic-ai 1.106: it logs an
ERROR importing the moved pydantic_ai._tool_manager.ToolManager (only the
ToolManager span-type label is lost; tracing is otherwise intact) and emits
Agent(instrument=...) / AgentRunResult.usage() deprecation warnings from its
own autolog code. Enable autolog with silent=True to mute mlflow's wrapped
logs, plus a message-scoped filter for the one raw Agent(instrument=...)
warning that still escapes (we never pass instrument= ourselves). Verified:
0 autolog noise lines, tracing still works. Drop once mlflow catches up.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Add a controllable 1D heat-rod plant + reduced-order surrogates so the
MPC loop can plan against a trained PINN field model:

- heat_rod.py: FTCS ground-truth plant (FiniteDifferenceHeatRod, with a
  stability guard), step-dataset generator, MLP ROM (train_step_surrogate),
  and build_heat_rod_problem_spec — a parametric PINN problem T(x,t,u)
  with the right-boundary temperature T(1,t,u)=u as the control input.
- pinn_surrogate.py: PINN field-mean -> scalar rollout surrogate
  (make_pinn_rollout_surrogate / register_pinn_surrogate) for horizon planning.
- Composition-first control inputs: ControlParameterSpec +
  ProblemSpec.control_parameters (merged into domain_bounds, sampled during
  training) and a parametric_dirichlet ConditionSpec.kind pinning an output
  field to a sampled input axis.
- register_pinn_surrogate_tool on the control toolset; lazy imports in the
  toolset break the control<->schemas import cycle.
- Functional tests (real MPC steps, real training) + demo notebook 04 reuses
  build_heat_rod_problem_spec.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
PINA 0.2.6 -> 0.3.1 renamed several public symbols and tightened
discretise_domain. Migrate all call sites so pytest is warning-free again:

- DomainInterface: import from pina.domain (submodule path removed).
- FixedValue: import from pina.equation.zoo.
- AbstractProblem -> BaseProblem.
- PINN-family solvers aliased to their renamed *SingleModelSolver forms,
  keeping the short domain names (PINN, SAPINN, ...) in registry + annotations.
- discretise_domain no longer accepts domains="all"; drop the arg so the
  default samples all domains (fixes KeyError: 'all' during training).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- README: high-level architecture diagram (natural language -> pydantic-ai
  multi-agent team -> PINA / MLflow / marimo), a consolidated Stack table,
  and a Claude Code integration section (marimo MCP server + marimo-pair
  live-kernel workflow). Bump test count 225 -> 232.
- .marimo.toml: update the in-notebook AI assistant config (agent mode,
  Ollama devstral models, polars/plotly/mlflow rules).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- Bump version 0.3.1 -> 0.4.0.
- pyproject: add explicit fasta2a dep, drop the removed a2a extra, bump
  pydantic-ai-slim floor to >=2.10.0 ([ag-ui] retained).
- uv.lock: refresh via uv lock --upgrade (pydantic-ai 2.10, torch 2.13,
  transformers 5.13, PINA 0.3.1, plus transitive bumps).
- CHANGELOG: cut the 0.4.0 section.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
astral-sh/setup-uv publishes moving major tags only up to v7; the v8 line
exists solely as exact releases, so `@v8` fails to resolve ("unable to find
version v8") and blocked every workflow run. Pin to the latest v8 release,
preserving the Node-24 intent of the earlier majors bump.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@bjoernbethge
bjoernbethge merged commit 04c4353 into main Jul 15, 2026
1 of 2 checks passed
@bjoernbethge
bjoernbethge deleted the release/0.4.0 branch July 15, 2026 10:51
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.

2 participants