Skip to content

feat(api): in-memory compute routes (plan/simulate/validate) + plot/preview route #189

Closed

Description

@CameronBrooks11

Part of the local-API GUI architecture epic.

Scope

Body-based variants of the compute operations that take in-memory input and return full results (no server-side files):

  • POST /plan — accept a WindDefinition JSON body → return the full PlanResult including the G-code commands (today's /plan/from-file returns only a count + a server path).
  • POST /simulate — accept {commands} or raw gcode → SimulationResult.
  • POST /validate — accept a WindDefinition body → ok/errors.
  • POST /plot (new — missing today) — accept {commands, scale} → PNG (render_plot(...).to_png_bytes()).

Why

The core is already fully model-based and in-memory (plan_wind(WindDefinition), simulate_program(lines), render_plot(lines).to_png_bytes()), so each route is ~5–10 lines of glue. The current /from-file shape is a remote/shared-filesystem assumption the desktop GUI doesn't need.

Acceptance

  • The GUI can plan/simulate/validate/preview entirely via request bodies; no temp files cross the boundary.

Activity

  1. added
    enhancement
    python
    on Jun 26, 2026
  2. CameronBrooks11 commented on Jun 26, 2026

    @CameronBrooks11
    MemberAuthor

    Plan-review verdict (2026-06-25): SIMPLIFY. Body-only. Delete /from-file (×3), /stream, and path_policy.py as explicit acceptance criteria — do not maintain a path-API and a body-API. Output uses the shared versioned schema #198 (kill the hand-rename DTOs at schemas.py:24-27). Decide /plan output: an artifact/job reference, not the 243k-line G-code inline.

  3. added a commit that references this issue on Jun 26, 2026
    2278841
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpython

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions