`%optimize` and `%configure` have no machine-readable form (`-json`)

Abierto
#2,342 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go

Línea de trabajo

Start with internal/frontend/repl/optimize.go and repl.SolveReport in check.go, then trace how %check -json is parsed and emitted in the CLI and REPL. Define and document a stable solver-report JSON shape for %optimize and %configure, with tests for normal, unsat, and unknown results and unchanged text output. Done means consumers can read reports as JSON while existing text output and exit codes remain unchanged.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Disclaimer, this issue was detected and written by an AI

Summary

%optimize returns a structured []SolveReport in Go but only prose through
the REPL/CLI; %configure has no structured form at all. Tools that want the
optima (a trade-study UI, a results comparison) must scrape terminal text, or
cannot offer the verb.

%check already has a JSON form (-json, one JSON document), so the shape to
follow exists.

Current state

  • internal/frontend/repl/optimize.go:16 — OptimizeSolve returns
    []SolveReport; repl.SolveReport (check.go:58) has no json: tags.
  • No -json arm for %optimize/%configure; -json selects check-report JSON.
  • The service/CLI RPCs are unaffected; this is an output-contract issue.

Proposal

Define and document a JSON document for solver reports, mirroring -check -json:
one JSON object per command run, with subject, status (sat/unsat/
unknown), solver, values (name/value/unit), and lines for the human
explanation. Add -json (or %optimize -json/%configure -json) on the CLI and
REPL; when the flag is set, write only that document and no prose. Give the struct
tags and a stable schema; keep existing text output unchanged without the flag.

Tests

  • A solver demo: %optimize -json emits one object per report with the stable
    fields; %optimize without the flag is byte-identical to today.
  • %configure -json covers the same shape (or a documented subset).
  • An unsat/unknown case carries status and the explanation, not an empty object.

Acceptance

  • The JSON shape is documented (wire-contract or CLI reference) and tagged.
  • -json changes only the output form; exit codes and text mode unchanged.
  • A consumer can read optima without parsing prose.
Lenguaje dominante
Go
Estrellas
59
Forks
20
Merge medio
10 h 23 min
PR fusionados (30 d)
897

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Open-MBEE/OpenSysML

Todos los issues de Open-MBEE/OpenSysML

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.