Skip to content

Add pddl-visualizer plugin (v0.1.0)#59

Draft
omereliy wants to merge 2 commits into
mainfrom
feature/pddl-visualizer-plugin
Draft

Add pddl-visualizer plugin (v0.1.0)#59
omereliy wants to merge 2 commits into
mainfrom
feature/pddl-visualizer-plugin

Conversation

@omereliy

Copy link
Copy Markdown
Collaborator

Summary

Adds a new pddl-visualizer plugin (v0.1.0) that renders a PDDL state or trajectory to an image, using a domain-independent predicate-graph. It consumes the grounded predicate-string state/trajectory that pddl-parser and pddl-validator already emit, so it does no PDDL parsing or simulation itself — it's a pure render function.

Tier 1 (pure pip), no Docker, no system binaries (networkx + matplotlib + Pillow; deliberately not graphviz/dot).

Mapping (any domain, zero config)

Predicate Example Rendered as
0-arity (handempty) flag in a side panel
unary (clear a) property label on node a
binary (on a b) directed edge a → b labelled on
n-arity (≥3) (connected x y z) square predicate-node wired to each arg
numeric (= (fuel t) 5) fuel=5 annotation on node t (or side panel)

Tools

  • render_state(state, output_path?, layout?, fmt?, title?) → PNG/SVG.
  • render_trajectory(trajectory, output_path?, fmt?, layout?, highlight_changes?, frame_seconds?) → animated GIF or filmstrip PNG. Eats get_trajectory's output dict directly; node layout is shared across frames and facts added at each step are highlighted.

Rendering quality

Axis limits are fitted to the true rendered extents of nodes + labels, so long peripheral labels never clip on any layout. Trajectory frames/panels share one unioned data window, so node positions stay pixel-stable across frames.

Verification

  • plugins/pddl-visualizer/tests/verify.py: 18 smoke/regression tests (both tools, all input forms + layouts, GIF/filmstrip, a no-clip regression guard, the shared-window math, FastMCP arg-error wrapper).
  • Registered in .claude-plugin/marketplace.json and .cursor-plugin/marketplace.json; added to the shared MCP protocol test; documented in README.md and root CLAUDE.md.
  • tests/static_checks.py, tests/mcp_protocol_test.py, and install_marketplace.sh auto-discovery all pass.

omereliy added 2 commits June 18, 2026 15:03
New Tier 1 (pure-pip) plugin that renders a PDDL state or trajectory to
an image via a domain-independent predicate-graph: objects are nodes,
unary predicates become node properties, binary predicates become
labelled edges, n-ary predicates become predicate-nodes, and numeric
fluents become annotations. Consumes the grounded predicate-string
state/trajectory that pddl-parser and pddl-validator already emit, so it
does no PDDL parsing or simulation itself.

- MCP server with two tools: render_state (PNG/SVG) and render_trajectory
  (animated GIF or filmstrip PNG, with a shared per-frame layout and
  highlighting of facts added at each step).
- Rendering stack: networkx + matplotlib (Agg) + Pillow. No Docker, no
  graphviz/system binaries.
- Axis limits are fitted to the true rendered extents of nodes and labels
  so long peripheral labels never clip; trajectory frames share one
  unioned data window so node positions stay pixel-stable across frames.
- verify.py: 18 smoke/regression tests. Registered in both marketplace
  catalogs and the MCP protocol test; documented in README and CLAUDE.md.
Surfaced while rendering a 16-object, 30-step barman plan:

- render_trajectory GIF held every frame's matplotlib figure open at once
  (warned past 20 figures, wasted memory). Rewrite to a two-pass
  measure-then-render so only one figure is open at a time while still
  sharing one data window across frames for pixel-stable node positions.
- Wrap long titles (verbose grounded action names) and enable
  constrained_layout for filmstrips so per-panel titles no longer collide.

Adds a regression test asserting a 24-frame trajectory leaks no figures
and never triggers the open-figure warning. verify.py: 19 tests.
@omereliy omereliy marked this pull request as draft June 19, 2026 08:52
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.

1 participant